@semcore/d3-chart 18.0.0 → 18.1.0-prerelease.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/lib/cjs/Area.js +12 -12
- package/lib/cjs/Axis.js +15 -15
- package/lib/cjs/Bar.js +16 -16
- package/lib/cjs/Bubble.js +14 -14
- package/lib/cjs/CompactHorizontalBar.js +16 -16
- package/lib/cjs/Donut.js +13 -11
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +12 -12
- package/lib/cjs/HorizontalBar.js +16 -16
- package/lib/cjs/Hover.js +15 -17
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Pattern.js +6 -6
- package/lib/cjs/Plot.js +2 -2
- package/lib/cjs/Radar.js +19 -19
- package/lib/cjs/RadialTree.js +12 -12
- package/lib/cjs/Reference.js +148 -55
- package/lib/cjs/Reference.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +9 -9
- package/lib/cjs/Tooltip.js +12 -12
- package/lib/cjs/Venn.js +9 -9
- package/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/lib/cjs/component/Chart/AbstractChart.js +16 -13
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.js +25 -0
- package/lib/cjs/component/Chart/LineChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +22 -14
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/legend-flex.shadow.css +12 -0
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +19 -17
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/legend-item.shadow.css +12 -0
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +11 -11
- package/lib/cjs/style/abstract-chart.shadow.css +2 -2
- package/lib/cjs/style/area.shadow.css +1 -1
- package/lib/cjs/style/donut.shadow.css +1 -1
- package/lib/cjs/style/line.shadow.css +2 -2
- package/lib/cjs/style/plot.shadow.css +4 -0
- package/lib/cjs/style/reference.shadow.css +7 -10
- package/lib/cjs/types/Reference.d.js.map +1 -1
- package/lib/es6/Area.js +12 -12
- package/lib/es6/Axis.js +15 -15
- package/lib/es6/Bar.js +16 -16
- package/lib/es6/Bubble.js +14 -14
- package/lib/es6/CompactHorizontalBar.js +16 -16
- package/lib/es6/Donut.js +13 -11
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +12 -12
- package/lib/es6/HorizontalBar.js +16 -16
- package/lib/es6/Hover.js +15 -17
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Pattern.js +6 -6
- package/lib/es6/Plot.js +2 -2
- package/lib/es6/Radar.js +19 -19
- package/lib/es6/RadialTree.js +12 -12
- package/lib/es6/Reference.js +148 -55
- package/lib/es6/Reference.js.map +1 -1
- package/lib/es6/ScatterPlot.js +9 -9
- package/lib/es6/Tooltip.js +12 -12
- package/lib/es6/Venn.js +9 -9
- package/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/lib/es6/a11y/PlotA11yView.js +2 -2
- package/lib/es6/component/Chart/AbstractChart.js +16 -13
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.js +26 -1
- package/lib/es6/component/Chart/LineChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +22 -14
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/legend-flex.shadow.css +12 -0
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +19 -17
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/legend-item.shadow.css +12 -0
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +11 -11
- package/lib/es6/style/abstract-chart.shadow.css +2 -2
- package/lib/es6/style/area.shadow.css +1 -1
- package/lib/es6/style/donut.shadow.css +1 -1
- package/lib/es6/style/line.shadow.css +2 -2
- package/lib/es6/style/plot.shadow.css +4 -0
- package/lib/es6/style/reference.shadow.css +7 -10
- package/lib/es6/types/Reference.d.js.map +1 -1
- package/lib/esm/Area.mjs +13 -13
- package/lib/esm/Axis.mjs +16 -16
- package/lib/esm/Bar.mjs +17 -17
- package/lib/esm/Bubble.mjs +15 -15
- package/lib/esm/CompactHorizontalBar.mjs +17 -17
- package/lib/esm/Donut.mjs +14 -12
- package/lib/esm/Dots.mjs +13 -13
- package/lib/esm/HorizontalBar.mjs +17 -17
- package/lib/esm/Hover.mjs +16 -18
- package/lib/esm/Line.mjs +10 -10
- package/lib/esm/Pattern.mjs +7 -7
- package/lib/esm/Plot.mjs +3 -3
- package/lib/esm/Radar.mjs +20 -20
- package/lib/esm/RadialTree.mjs +13 -13
- package/lib/esm/Reference.mjs +145 -56
- package/lib/esm/ScatterPlot.mjs +10 -10
- package/lib/esm/Tooltip.mjs +13 -13
- package/lib/esm/Venn.mjs +10 -10
- package/lib/esm/a11y/PlotA11yModule.mjs +3 -3
- package/lib/esm/a11y/PlotA11yView.mjs +3 -3
- package/lib/esm/component/Chart/AbstractChart.mjs +17 -14
- package/lib/esm/component/Chart/CigaretteChart.mjs +1 -1
- package/lib/esm/component/Chart/LineChart.mjs +26 -0
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +23 -15
- package/lib/esm/component/ChartLegend/LegendFlex/legend-flex.shadow.css +12 -0
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +20 -18
- package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +12 -0
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +12 -12
- package/lib/esm/style/abstract-chart.shadow.css +2 -2
- package/lib/esm/style/area.shadow.css +1 -1
- package/lib/esm/style/donut.shadow.css +1 -1
- package/lib/esm/style/line.shadow.css +2 -2
- package/lib/esm/style/plot.shadow.css +4 -0
- package/lib/esm/style/reference.shadow.css +7 -10
- package/lib/types/Reference.d.ts +21 -4
- package/lib/types/component/Chart/AbstractChart.d.ts +1 -0
- package/lib/types/component/Chart/AbstractChart.d.ts.map +1 -1
- package/lib/types/component/Chart/LineChart.d.ts.map +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +36 -0
- package/lib/types/component/Chart/LineChart.type.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.d.ts.map +1 -1
- package/package.json +15 -14
- package/vite.config.ts +1 -0
|
@@ -16,15 +16,23 @@ var _intergalacticDynamicLocales = require("../../../translations/__intergalacti
|
|
|
16
16
|
var _BaseLegend = require("../BaseLegend");
|
|
17
17
|
var _LegendItem = require("../LegendItem/LegendItem");
|
|
18
18
|
/*!__reshadow-styles__:"./legend-flex.shadow.css"*/
|
|
19
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
19
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SLegendFlex_jdbru_gg_._direction_row_jdbru_gg_{align-items:flex-start;align-content:flex-start;flex-wrap:wrap;gap:var(--intergalactic-spacing-2x,8px) var(--intergalactic-spacing-4x,16px)}.___SLegendFlex_jdbru_gg_._direction_column_jdbru_gg_{align-items:flex-start;flex-wrap:wrap;gap:var(--intergalactic-spacing-2x,8px)}.___STrend_jdbru_gg_._size_m_jdbru_gg_>span:first-of-type{width:var(--intergalactic-spacing-4x,16px);height:var(--intergalactic-spacing-4x,16px);margin-top:var(--intergalactic-spacing-05x,2px)}.___STrend_jdbru_gg_._size_l_jdbru_gg_>span:first-of-type{width:var(--intergalactic-spacing-5x,20px);height:var(--intergalactic-spacing-5x,20px);margin-top:var(--intergalactic-spacing-05x,2px)}", /*__inner_css_end__*/"jdbru_gg_"),
|
|
20
20
|
/*__reshadow_css_end__*/
|
|
21
21
|
{
|
|
22
|
-
"__SLegendFlex": "
|
|
23
|
-
"_direction_row": "
|
|
24
|
-
"_direction_column": "
|
|
22
|
+
"__SLegendFlex": "___SLegendFlex_jdbru_gg_",
|
|
23
|
+
"_direction_row": "_direction_row_jdbru_gg_",
|
|
24
|
+
"_direction_column": "_direction_column_jdbru_gg_",
|
|
25
|
+
"__STrend": "___STrend_jdbru_gg_",
|
|
26
|
+
"_size_m": "_size_m_jdbru_gg_",
|
|
27
|
+
"_size_l": "_size_l_jdbru_gg_"
|
|
25
28
|
});
|
|
26
29
|
class LegendFlexRoot extends _BaseLegend.BaseLegend {
|
|
27
30
|
renderTrend() {
|
|
31
|
+
var _ref2;
|
|
32
|
+
const STrend = _checkbox.default;
|
|
33
|
+
const {
|
|
34
|
+
styles
|
|
35
|
+
} = this.asProps;
|
|
28
36
|
const {
|
|
29
37
|
onTrendIsVisibleChange,
|
|
30
38
|
trendIsVisible,
|
|
@@ -32,17 +40,17 @@ class LegendFlexRoot extends _BaseLegend.BaseLegend {
|
|
|
32
40
|
size,
|
|
33
41
|
getI18nText
|
|
34
42
|
} = this.asProps;
|
|
35
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
36
|
-
checked: trendIsVisible,
|
|
37
|
-
onChange: onTrendIsVisibleChange,
|
|
38
|
-
theme:
|
|
39
|
-
label: trendLabel ?? getI18nText('trend'),
|
|
40
|
-
size: size
|
|
41
|
-
});
|
|
43
|
+
return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(STrend, _ref2.cn("STrend", {
|
|
44
|
+
"checked": trendIsVisible,
|
|
45
|
+
"onChange": onTrendIsVisibleChange,
|
|
46
|
+
"theme": 'gray-400',
|
|
47
|
+
"label": trendLabel ?? getI18nText('trend'),
|
|
48
|
+
"size": size
|
|
49
|
+
}));
|
|
42
50
|
}
|
|
43
51
|
render() {
|
|
44
52
|
var _ref = this.asProps,
|
|
45
|
-
|
|
53
|
+
_ref3;
|
|
46
54
|
const SLegendFlex = _baseComponents.Flex;
|
|
47
55
|
const {
|
|
48
56
|
styles,
|
|
@@ -53,7 +61,7 @@ class LegendFlexRoot extends _BaseLegend.BaseLegend {
|
|
|
53
61
|
items
|
|
54
62
|
} = this.asProps;
|
|
55
63
|
const orientation = direction === 'row' ? 'vertical' : 'horizontal';
|
|
56
|
-
return
|
|
64
|
+
return _ref3 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SLegendFlex, _ref3.cn("SLegendFlex", {
|
|
57
65
|
...(0, _core.assignProps)({
|
|
58
66
|
"role": 'group'
|
|
59
67
|
}, _ref)
|
|
@@ -63,7 +71,7 @@ class LegendFlexRoot extends _BaseLegend.BaseLegend {
|
|
|
63
71
|
return /*#__PURE__*/_react.default.createElement(Children, {
|
|
64
72
|
key: id
|
|
65
73
|
});
|
|
66
|
-
}), (withTrend || suffix) && /*#__PURE__*/_react.default.createElement(_divider.default,
|
|
74
|
+
}), (withTrend || suffix) && /*#__PURE__*/_react.default.createElement(_divider.default, _ref3.cn("Divider", {
|
|
67
75
|
"orientation": orientation
|
|
68
76
|
})), withTrend && this.renderTrend(), suffix ? suffix : null);
|
|
69
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendFlex.js","names":["_core","require","_baseComponents","_checkbox","_interopRequireDefault","_i18nEnhance","_divider","_react","_intergalacticDynamicLocales","_BaseLegend","_LegendItem","style","sstyled","insert","LegendFlexRoot","BaseLegend","renderTrend","
|
|
1
|
+
{"version":3,"file":"LegendFlex.js","names":["_core","require","_baseComponents","_checkbox","_interopRequireDefault","_i18nEnhance","_divider","_react","_intergalacticDynamicLocales","_BaseLegend","_LegendItem","style","sstyled","insert","LegendFlexRoot","BaseLegend","renderTrend","_ref2","STrend","Checkbox","styles","asProps","onTrendIsVisibleChange","trendIsVisible","trendLabel","size","getI18nText","default","createElement","cn","render","_ref","_ref3","SLegendFlex","Flex","Children","direction","withTrend","suffix","items","orientation","assignProps","map","id","key","_defineProperty2","i18nEnhance","localizedMessages","children","LegendFlex","LegendItem","exports","createComponent","LegendItemComponent"],"sources":["../../../../../src/component/ChartLegend/LegendFlex/LegendFlex.tsx"],"sourcesContent":["import { Flex } from '@semcore/base-components';\nimport Checkbox from '@semcore/checkbox';\nimport { createComponent, sstyled, Root } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport Divider from '@semcore/divider';\nimport React from 'react';\n\nimport style from './legend-flex.shadow.css';\nimport type { LegendFlexType, LegendFlexProps, TrendProps, LegendFlexDefaultProps } from './LegendFlex.type';\nimport { localizedMessages } from '../../../translations/__intergalactic-dynamic-locales';\nimport { BaseLegend } from '../BaseLegend';\nimport { LegendItemComponent } from '../LegendItem/LegendItem';\n\nclass LegendFlexRoot extends BaseLegend<\n LegendFlexProps,\n typeof LegendFlexRoot.enhance,\n LegendFlexDefaultProps\n> {\n static displayName = 'LegendFlex';\n static style = style;\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n static defaultProps = () => ({\n direction: 'row',\n children: <LegendFlex.LegendItem />,\n } as const);\n\n renderTrend() {\n const STrend = Checkbox;\n const { styles } = this.asProps;\n const { onTrendIsVisibleChange, trendIsVisible, trendLabel, size, getI18nText } = this\n .asProps as unknown as TrendProps & LegendFlexProps & { getI18nText: (s: string) => string };\n\n return sstyled(styles)(\n <STrend\n checked={trendIsVisible}\n onChange={onTrendIsVisibleChange}\n theme='gray-400'\n label={trendLabel ?? getI18nText('trend')}\n size={size}\n />,\n );\n }\n\n render() {\n const SLegendFlex = Root;\n const { styles, Children, direction, withTrend, suffix, items } = this.asProps;\n const orientation = direction === 'row' ? 'vertical' : 'horizontal';\n\n return sstyled(styles)(\n <SLegendFlex render={Flex} role='group'>\n {items.map(({ id }) => {\n return <Children key={id} />;\n })}\n {(withTrend || suffix) && <Divider orientation={orientation} />}\n {withTrend && this.renderTrend()}\n {suffix ? suffix : null}\n </SLegendFlex>,\n );\n }\n}\n\n/**\n * LegendFlex\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/chart-legend/chart-legend-api/|API} | {@link https://developer.semrush.com/intergalactic/data-display/chart-legend/chart-legend-code/|Examples}\n */\nexport const LegendFlex = createComponent<\n LegendFlexType,\n typeof LegendFlexRoot\n>(LegendFlexRoot, {\n LegendItem: LegendItemComponent,\n});\n"],"mappings":";;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,QAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,MAAA,GAAAH,sBAAA,CAAAH,OAAA;AAIA,IAAAO,4BAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAA+D;AAAA,MAAAU,KAAA,8BAAAX,KAAA,CAAAY,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAE/D,MAAMC,cAAc,SAASC,sBAAU,CAIrC;EAWAC,WAAWA,CAAA,EAAG;IAAA,IAAAC,KAAA;IACZ,MAAMC,MAAM,GAAGC,iBAAQ;IACvB,MAAM;MAAEC;IAAO,CAAC,GAAG,IAAI,CAACC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AA,eAAcW;IAAW,EAAG,CAAC,EAC9DH,SAAS,IAAI,IAAI,CAACrB,WAAW,CAAC,CAAC,EAC/BsB,MAAM,GAAGA,MAAM,GAAG,IACR,CAAC;EAElB;AACF;;AAEA;AACA;AACA;AACA;AACA;AAJA,IAAAO,gBAAA,CAAAlB,OAAA,EAlDMb,cAAc,iBAKG,YAAY;AAAA,IAAA+B,gBAAA,CAAAlB,OAAA,EAL7Bb,cAAc,WAMHH,KAAK;AAAA,IAAAkC,gBAAA,CAAAlB,OAAA,EANhBb,cAAc,aAQD,CAAC,IAAAgC,oBAAW,EAACC,8CAAiB,CAAC,CAAC;AAAA,IAAAF,gBAAA,CAAAlB,OAAA,EAR7Cb,cAAc,kBAUI,OAAO;EAC3BsB,SAAS,EAAE,KAAK;EAChBY,QAAQ,eAAEzC,MAAA,CAAAoB,OAAA,CAAAC,aAAA,CAACqB,UAAU,CAACC,UAAU,MAAE;AACpC,CAAC,CAAU;AA0CN,MAAMD,UAAU,GAAAE,OAAA,CAAAF,UAAA,GAAG,IAAAG,qBAAe,EAGvCtC,cAAc,EAAE;EAChBoC,UAAU,EAAEG;AACd,CAAC,CAAC","ignoreList":[]}
|
|
@@ -10,3 +10,15 @@ SLegendFlex[direction='column'] {
|
|
|
10
10
|
flex-wrap: wrap;
|
|
11
11
|
gap: var(--intergalactic-spacing-2x, 8px);
|
|
12
12
|
}
|
|
13
|
+
|
|
14
|
+
STrend[size='m'] > span:first-of-type {
|
|
15
|
+
width: var(--intergalactic-spacing-4x, 16px);
|
|
16
|
+
height: var(--intergalactic-spacing-4x, 16px);
|
|
17
|
+
margin-top: var(--intergalactic-spacing-05x, 2px);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
STrend[size='l'] > span:first-of-type {
|
|
21
|
+
width: var(--intergalactic-spacing-5x, 20px);
|
|
22
|
+
height: var(--intergalactic-spacing-5x, 20px);
|
|
23
|
+
margin-top: var(--intergalactic-spacing-05x, 2px);
|
|
24
|
+
}
|
|
@@ -17,24 +17,25 @@ var _LegendItem = require("./LegendItem.type");
|
|
|
17
17
|
var _Pattern = require("../../../Pattern");
|
|
18
18
|
var _utils = require("../../../utils");
|
|
19
19
|
/*!__reshadow-styles__:"./legend-item.shadow.css"*/
|
|
20
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
20
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SLegendItem_1acwd_gg_{min-width:0;align-items:flex-start}@media (hover:hover){.___SLegendItem_1acwd_gg_:hover{cursor:pointer}.___SLegendItem_1acwd_gg_.__disabled_1acwd_gg_:hover{cursor:default}}.___SLegendItem_1acwd_gg_.__transparent_1acwd_gg_{opacity:.3}.___SCheckbox_1acwd_gg_._size_m_1acwd_gg_>span:first-of-type{width:var(--intergalactic-spacing-4x,16px);height:var(--intergalactic-spacing-4x,16px);margin-top:var(--intergalactic-spacing-05x,2px)}.___SCheckbox_1acwd_gg_._size_l_1acwd_gg_>span:first-of-type{width:var(--intergalactic-spacing-5x,20px);height:var(--intergalactic-spacing-5x,20px);margin-top:var(--intergalactic-spacing-05x,2px)}.___SPointShape_1acwd_gg_.__color_1acwd_gg_{background-color:var(--color_1acwd);margin-right:var(--intergalactic-spacing-1-5x,6px);flex-shrink:0}.___SPointShape_1acwd_gg_._shape_Circle_1acwd_gg_._size_l_1acwd_gg_{width:16px;height:16px;border-radius:8px;margin-top:var(--intergalactic-spacing-1x,4px)}.___SPointShape_1acwd_gg_._shape_Circle_1acwd_gg_._size_m_1acwd_gg_{width:12px;height:12px;border-radius:6px;margin-top:var(--intergalactic-spacing-1x,4px)}.___SPointShape_1acwd_gg_._shape_Pattern_1acwd_gg_{background-color:initial;margin-right:var(--intergalactic-spacing-1x,4px)}.___SIcon_1acwd_gg_{line-height:0;margin-right:var(--intergalactic-spacing-1x,4px)}.___SIcon_1acwd_gg_._size_l_1acwd_gg_{margin-top:var(--intergalactic-spacing-1x,4px)}.___SIcon_1acwd_gg_._size_m_1acwd_gg_{margin-top:var(--intergalactic-spacing-05x,2px)}.___SLabel_1acwd_gg_{min-width:0}.___SAdditionalLabel_1acwd_gg_._size_l_1acwd_gg_,.___SCount_1acwd_gg_._size_l_1acwd_gg_,.___SLabel_1acwd_gg_._size_l_1acwd_gg_{font-size:var(--intergalactic-fs-300,16px);line-height:var(--intergalactic-lh-300,1.5)}.___SAdditionalLabel_1acwd_gg_._size_m_1acwd_gg_,.___SCount_1acwd_gg_._size_m_1acwd_gg_,.___SLabel_1acwd_gg_._size_m_1acwd_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}.___SAdditionalLabel_1acwd_gg_,.___SCount_1acwd_gg_{margin-left:var(--intergalactic-spacing-1x,4px)}.___SAdditionalLabel_1acwd_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_1acwd_gg_:before{content:\"\";display:inline-block;background-color:var(--intergalactic-text-secondary,oklch(.182 .045 244.8/.593));height:4px;width:4px;border-radius:2px;margin-right:var(--intergalactic-spacing-1x,4px)}.___SAdditionalLabel_1acwd_gg_._size_l_1acwd_gg_:before{margin-top:10px}.___SAdditionalLabel_1acwd_gg_._size_m_1acwd_gg_:before{margin-top:8px}.___SPatternSymbol_1acwd_gg_{transform:scale(.8)}", /*__inner_css_end__*/"1acwd_gg_"),
|
|
21
21
|
/*__reshadow_css_end__*/
|
|
22
22
|
{
|
|
23
|
-
"__SLegendItem": "
|
|
24
|
-
"_disabled": "
|
|
25
|
-
"_transparent": "
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
23
|
+
"__SLegendItem": "___SLegendItem_1acwd_gg_",
|
|
24
|
+
"_disabled": "__disabled_1acwd_gg_",
|
|
25
|
+
"_transparent": "__transparent_1acwd_gg_",
|
|
26
|
+
"__SCheckbox": "___SCheckbox_1acwd_gg_",
|
|
27
|
+
"_size_m": "_size_m_1acwd_gg_",
|
|
28
|
+
"_size_l": "_size_l_1acwd_gg_",
|
|
29
|
+
"__SPointShape": "___SPointShape_1acwd_gg_",
|
|
30
|
+
"_color": "__color_1acwd_gg_",
|
|
31
|
+
"--color": "--color_1acwd",
|
|
32
|
+
"_shape_Circle": "_shape_Circle_1acwd_gg_",
|
|
33
|
+
"_shape_Pattern": "_shape_Pattern_1acwd_gg_",
|
|
34
|
+
"__SIcon": "___SIcon_1acwd_gg_",
|
|
35
|
+
"__SLabel": "___SLabel_1acwd_gg_",
|
|
36
|
+
"__SAdditionalLabel": "___SAdditionalLabel_1acwd_gg_",
|
|
37
|
+
"__SCount": "___SCount_1acwd_gg_",
|
|
38
|
+
"__SPatternSymbol": "___SPatternSymbol_1acwd_gg_"
|
|
38
39
|
});
|
|
39
40
|
const enhance = [(0, _resolveColorEnhance.default)(), (0, _uniqueID.default)()];
|
|
40
41
|
class LegendItemRoot extends _core.Component {
|
|
@@ -190,6 +191,7 @@ function Shape(props) {
|
|
|
190
191
|
_ref0;
|
|
191
192
|
const SPointShape = _baseComponents.Box;
|
|
192
193
|
const SPatternSymbol = _Pattern.PatternSymbol;
|
|
194
|
+
const SCheckbox = _checkbox.default;
|
|
193
195
|
const {
|
|
194
196
|
styles,
|
|
195
197
|
size,
|
|
@@ -221,7 +223,7 @@ function Shape(props) {
|
|
|
221
223
|
}
|
|
222
224
|
if (shape === 'Checkbox') {
|
|
223
225
|
var _ref9;
|
|
224
|
-
return _ref9 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(
|
|
226
|
+
return _ref9 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(SCheckbox, _ref9.cn("SCheckbox", {
|
|
225
227
|
"size": size,
|
|
226
228
|
"checked": checked,
|
|
227
229
|
"theme": color,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendItem.js","names":["_core","require","_baseComponents","_checkbox","_interopRequireDefault","_resolveColorEnhance","_uniqueID","_typography","_react","_LegendItem","_Pattern","_utils","style","sstyled","insert","enhance","resolveColorEnhance","uniqueIDEnhancement","LegendItemRoot","Component","getUniqueID","uid","asProps","getShapeProps","checked","color","shape","label","id","size","resolveColor","patterns","onChangeLegendItem","onFocusLegendItem","onBlurLegendItem","value","onFocus","onBlur","getIconProps","onMouseEnter","onMouseLeave","props","children","icon","onClick","getLabelProps","_color","_shape","getAdditionalLabelProps","additionalInfo","undefined","getCountProps","count","render","_ref","_ref7","SLegendItem","Flex","styles","Children","disabled","StaticShapes","includes","default","createElement","cn","assignProps","_defineProperty2","Fragment","LegendItemComponent","Shape","Icon","Label","AdditionalLabel","Count","_ref2","arguments[0]","_ref0","SPointShape","Box","SPatternSymbol","PatternSymbol","patternKey","getChartDefaultColorName","hasChildren","onChange","_ref8","_ref9","_ref3","_ref1","SIcon","displayName","_ref4","_ref10","SLabel","TypographyText","_ref5","_ref11","SAdditionalLabel","_ref6","_ref12","SCount","exports","createComponent"],"sources":["../../../../../src/component/ChartLegend/LegendItem/LegendItem.tsx"],"sourcesContent":["import { Flex, Box } from '@semcore/base-components';\nimport Checkbox from '@semcore/checkbox';\nimport { type Intergalactic, createComponent, Component, sstyled, Root } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport { Text as TypographyText } from '@semcore/typography';\nimport React from 'react';\n\nimport style from './legend-item.shadow.css';\nimport {\n type LegendItemShapeType,\n type LegendItemDefaultProps,\n type LegendItemType,\n StaticShapes,\n type LegendItemIconType,\n type LegendItemLabelType,\n type LegendItemAdditionalLabelType,\n type LegendItemCountType,\n} from './LegendItem.type';\nimport { PatternSymbol } from '../../../Pattern';\nimport { getChartDefaultColorName } from '../../../utils';\n\nconst enhance = [resolveColorEnhance(), uniqueIDEnhancement()] as const;\nclass LegendItemRoot extends Component<\n Intergalactic.InternalTypings.InferComponentProps<LegendItemType>,\n typeof enhance,\n {},\n {},\n {},\n LegendItemDefaultProps\n> {\n static displayName = 'LegendItem';\n static style = style;\n\n static enhance = enhance;\n\n static defaultProps = () => ({\n children: (\n <>\n <LegendItemComponent.Shape />\n <LegendItemComponent.Icon />\n <LegendItemComponent.Label />\n <LegendItemComponent.AdditionalLabel />\n <LegendItemComponent.Count />\n </>\n ),\n });\n\n getUniqueID() {\n const { uid } = this.asProps;\n return `chart-legend-item-${uid}`;\n }\n\n getShapeProps() {\n const {\n checked,\n color,\n shape,\n label,\n id,\n size,\n resolveColor,\n patterns,\n onChangeLegendItem,\n onFocusLegendItem,\n onBlurLegendItem,\n } = this.asProps;\n\n return {\n label,\n shape,\n checked,\n 'color': resolveColor(color),\n 'patternKey': color,\n patterns,\n size,\n 'onChange': (value: boolean) => {\n if (onChangeLegendItem && id) {\n onChangeLegendItem(id, value);\n }\n },\n 'onFocus': () => {\n if (onFocusLegendItem && id) {\n onFocusLegendItem(id);\n }\n },\n 'onBlur': () => {\n if (onBlurLegendItem && id) {\n onBlurLegendItem(id);\n }\n },\n 'aria-labelledby': shape === 'Checkbox' ? this.getUniqueID() : null,\n };\n }\n\n getIconProps() {\n const { onMouseEnter, onMouseLeave, ...props } = this.asProps;\n\n return {\n ...props,\n children: props.icon,\n onClick: () => {\n if (props.onChangeLegendItem && props.id) {\n props.onChangeLegendItem(props.id, !props.checked);\n }\n },\n };\n }\n\n getLabelProps() {\n const { id, checked, color: _color, onChangeLegendItem, shape: _shape, onMouseEnter, onMouseLeave, ...props } = this.asProps;\n\n return {\n ...props,\n id: this.getUniqueID(),\n checked,\n onClick: () => {\n if (onChangeLegendItem && id) {\n onChangeLegendItem(id, !checked);\n }\n },\n children: props.label,\n };\n }\n\n getAdditionalLabelProps() {\n const props = this.asProps;\n\n const { additionalInfo, onChangeLegendItem, id, checked } = props;\n\n return {\n ...props,\n children: additionalInfo && 'label' in additionalInfo ? `${additionalInfo.label}` : undefined,\n onClick: () => {\n if (onChangeLegendItem && id) {\n onChangeLegendItem(id, !checked);\n }\n },\n };\n }\n\n getCountProps() {\n const props = this.asProps;\n\n const { additionalInfo, onChangeLegendItem, id, checked } = props;\n\n return {\n ...props,\n children:\n additionalInfo && 'count' in additionalInfo ? `(${additionalInfo.count})` : undefined,\n onClick: () => {\n if (onChangeLegendItem && id) {\n onChangeLegendItem(id, !checked);\n }\n },\n };\n }\n\n render() {\n const SLegendItem = Root;\n const { styles, Children, shape } = this.asProps;\n\n // @ts-ignore\n const disabled = StaticShapes.includes(shape) || shape === undefined;\n\n return sstyled(styles)(\n <SLegendItem render={Flex} disabled={disabled} __excludeProps={['id']}>\n <Children />\n </SLegendItem>,\n );\n }\n}\n\nfunction Shape(\n props: Intergalactic.InternalTypings.InferChildComponentProps<LegendItemShapeType, typeof LegendItemRoot, 'Shape'>,\n) {\n const SPointShape = Root;\n const SPatternSymbol = PatternSymbol;\n const {\n styles,\n size,\n shape,\n checked,\n color,\n patternKey = getChartDefaultColorName(0),\n Children,\n children: hasChildren,\n patterns,\n onChange,\n onFocus,\n onBlur,\n } = props;\n\n if (hasChildren) {\n return <Children />;\n }\n\n if (shape === 'Pattern') {\n return sstyled(styles)(\n <Box mr={1} mt='1px' mb='-1px'>\n <SPatternSymbol color={color} patternKey={patternKey} aria-hidden />\n </Box>,\n );\n }\n\n if (shape === 'Checkbox') {\n return sstyled(styles)(\n <>\n <Checkbox\n size={size}\n checked={checked}\n theme={color}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n aria-labelledby={props['aria-labelledby']}\n />\n {patterns && (\n <Box mt='2px' mr={1} onClick={() => onChange(!checked)}>\n <SPatternSymbol color={color} patternKey={patternKey} aria-hidden />\n </Box>\n )}\n </>,\n );\n }\n\n return sstyled(styles)(\n <SPointShape render={Box}>\n <Children />\n </SPointShape>,\n );\n}\n\nfunction Icon(\n props: Intergalactic.InternalTypings.InferChildComponentProps<LegendItemIconType, typeof LegendItemRoot, 'Icon'>,\n) {\n const { styles, children: hasChildren, Children } = props;\n const SIcon = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SIcon render={Box} tag='span'>\n <Children />\n </SIcon>,\n );\n}\nIcon.displayName = 'Icon';\n\nfunction Label(\n props: Intergalactic.InternalTypings.InferChildComponentProps<LegendItemLabelType, typeof LegendItemRoot, 'Label'>,\n) {\n const { styles, children: hasChildren, Children } = props;\n const SLabel = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SLabel render={TypographyText} use='primary'>\n <Children />\n </SLabel>,\n );\n}\nLabel.displayName = 'Label';\n\nfunction AdditionalLabel(\n props: Intergalactic.InternalTypings.InferChildComponentProps<LegendItemAdditionalLabelType, typeof LegendItemRoot, 'AdditionalLabel'>,\n) {\n const { styles, children: hasChildren, Children } = props;\n const SAdditionalLabel = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SAdditionalLabel render={TypographyText} use='secondary'>\n <Children />\n </SAdditionalLabel>,\n );\n}\nAdditionalLabel.displayName = 'AdditionalLabel';\n\nfunction Count(\n props: Intergalactic.InternalTypings.InferChildComponentProps<LegendItemCountType, typeof LegendItemRoot, 'Count'>,\n) {\n const { styles, children: hasChildren, Children } = props;\n const SCount = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SCount render={TypographyText} use='secondary'>\n <Children />\n </SCount>,\n );\n}\nCount.displayName = 'Count';\n\n/**\n * LegendItemComponent\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/chart-legend/chart-legend-api/|API} | {@link https://developer.semrush.com/intergalactic/data-display/chart-legend/chart-legend-code/|Examples}\n */\nexport const LegendItemComponent = createComponent<\n LegendItemType,\n typeof LegendItemRoot\n>(LegendItemRoot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3,"file":"LegendItem.js","names":["_core","require","_baseComponents","_checkbox","_interopRequireDefault","_resolveColorEnhance","_uniqueID","_typography","_react","_LegendItem","_Pattern","_utils","style","sstyled","insert","enhance","resolveColorEnhance","uniqueIDEnhancement","LegendItemRoot","Component","getUniqueID","uid","asProps","getShapeProps","checked","color","shape","label","id","size","resolveColor","patterns","onChangeLegendItem","onFocusLegendItem","onBlurLegendItem","value","onFocus","onBlur","getIconProps","onMouseEnter","onMouseLeave","props","children","icon","onClick","getLabelProps","_color","_shape","getAdditionalLabelProps","additionalInfo","undefined","getCountProps","count","render","_ref","_ref7","SLegendItem","Flex","styles","Children","disabled","StaticShapes","includes","default","createElement","cn","assignProps","_defineProperty2","Fragment","LegendItemComponent","Shape","Icon","Label","AdditionalLabel","Count","_ref2","arguments[0]","_ref0","SPointShape","Box","SPatternSymbol","PatternSymbol","SCheckbox","Checkbox","patternKey","getChartDefaultColorName","hasChildren","onChange","_ref8","_ref9","_ref3","_ref1","SIcon","displayName","_ref4","_ref10","SLabel","TypographyText","_ref5","_ref11","SAdditionalLabel","_ref6","_ref12","SCount","exports","createComponent"],"sources":["../../../../../src/component/ChartLegend/LegendItem/LegendItem.tsx"],"sourcesContent":["import { Flex, Box } from '@semcore/base-components';\nimport Checkbox from '@semcore/checkbox';\nimport { type Intergalactic, createComponent, Component, sstyled, Root } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport { Text as TypographyText } from '@semcore/typography';\nimport React from 'react';\n\nimport style from './legend-item.shadow.css';\nimport {\n type LegendItemShapeType,\n type LegendItemDefaultProps,\n type LegendItemType,\n StaticShapes,\n type LegendItemIconType,\n type LegendItemLabelType,\n type LegendItemAdditionalLabelType,\n type LegendItemCountType,\n} from './LegendItem.type';\nimport { PatternSymbol } from '../../../Pattern';\nimport { getChartDefaultColorName } from '../../../utils';\n\nconst enhance = [resolveColorEnhance(), uniqueIDEnhancement()] as const;\nclass LegendItemRoot extends Component<\n Intergalactic.InternalTypings.InferComponentProps<LegendItemType>,\n typeof enhance,\n {},\n {},\n {},\n LegendItemDefaultProps\n> {\n static displayName = 'LegendItem';\n static style = style;\n\n static enhance = enhance;\n\n static defaultProps = () => ({\n children: (\n <>\n <LegendItemComponent.Shape />\n <LegendItemComponent.Icon />\n <LegendItemComponent.Label />\n <LegendItemComponent.AdditionalLabel />\n <LegendItemComponent.Count />\n </>\n ),\n });\n\n getUniqueID() {\n const { uid } = this.asProps;\n return `chart-legend-item-${uid}`;\n }\n\n getShapeProps() {\n const {\n checked,\n color,\n shape,\n label,\n id,\n size,\n resolveColor,\n patterns,\n onChangeLegendItem,\n onFocusLegendItem,\n onBlurLegendItem,\n } = this.asProps;\n\n return {\n label,\n shape,\n checked,\n 'color': resolveColor(color),\n 'patternKey': color,\n patterns,\n size,\n 'onChange': (value: boolean) => {\n if (onChangeLegendItem && id) {\n onChangeLegendItem(id, value);\n }\n },\n 'onFocus': () => {\n if (onFocusLegendItem && id) {\n onFocusLegendItem(id);\n }\n },\n 'onBlur': () => {\n if (onBlurLegendItem && id) {\n onBlurLegendItem(id);\n }\n },\n 'aria-labelledby': shape === 'Checkbox' ? this.getUniqueID() : null,\n };\n }\n\n getIconProps() {\n const { onMouseEnter, onMouseLeave, ...props } = this.asProps;\n\n return {\n ...props,\n children: props.icon,\n onClick: () => {\n if (props.onChangeLegendItem && props.id) {\n props.onChangeLegendItem(props.id, !props.checked);\n }\n },\n };\n }\n\n getLabelProps() {\n const { id, checked, color: _color, onChangeLegendItem, shape: _shape, onMouseEnter, onMouseLeave, ...props } = this.asProps;\n\n return {\n ...props,\n id: this.getUniqueID(),\n checked,\n onClick: () => {\n if (onChangeLegendItem && id) {\n onChangeLegendItem(id, !checked);\n }\n },\n children: props.label,\n };\n }\n\n getAdditionalLabelProps() {\n const props = this.asProps;\n\n const { additionalInfo, onChangeLegendItem, id, checked } = props;\n\n return {\n ...props,\n children: additionalInfo && 'label' in additionalInfo ? `${additionalInfo.label}` : undefined,\n onClick: () => {\n if (onChangeLegendItem && id) {\n onChangeLegendItem(id, !checked);\n }\n },\n };\n }\n\n getCountProps() {\n const props = this.asProps;\n\n const { additionalInfo, onChangeLegendItem, id, checked } = props;\n\n return {\n ...props,\n children:\n additionalInfo && 'count' in additionalInfo ? `(${additionalInfo.count})` : undefined,\n onClick: () => {\n if (onChangeLegendItem && id) {\n onChangeLegendItem(id, !checked);\n }\n },\n };\n }\n\n render() {\n const SLegendItem = Root;\n const { styles, Children, shape } = this.asProps;\n\n // @ts-ignore\n const disabled = StaticShapes.includes(shape) || shape === undefined;\n\n return sstyled(styles)(\n <SLegendItem render={Flex} disabled={disabled} __excludeProps={['id']}>\n <Children />\n </SLegendItem>,\n );\n }\n}\n\nfunction Shape(\n props: Intergalactic.InternalTypings.InferChildComponentProps<LegendItemShapeType, typeof LegendItemRoot, 'Shape'>,\n) {\n const SPointShape = Root;\n const SPatternSymbol = PatternSymbol;\n const SCheckbox = Checkbox;\n const {\n styles,\n size,\n shape,\n checked,\n color,\n patternKey = getChartDefaultColorName(0),\n Children,\n children: hasChildren,\n patterns,\n onChange,\n onFocus,\n onBlur,\n } = props;\n\n if (hasChildren) {\n return <Children />;\n }\n\n if (shape === 'Pattern') {\n return sstyled(styles)(\n <Box mr={1} mt='1px' mb='-1px'>\n <SPatternSymbol color={color} patternKey={patternKey} aria-hidden />\n </Box>,\n );\n }\n\n if (shape === 'Checkbox') {\n return sstyled(styles)(\n <>\n <SCheckbox\n size={size}\n checked={checked}\n theme={color}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n aria-labelledby={props['aria-labelledby']}\n />\n {patterns && (\n <Box mt='2px' mr={1} onClick={() => onChange(!checked)}>\n <SPatternSymbol color={color} patternKey={patternKey} aria-hidden />\n </Box>\n )}\n </>,\n );\n }\n\n return sstyled(styles)(\n <SPointShape render={Box}>\n <Children />\n </SPointShape>,\n );\n}\n\nfunction Icon(\n props: Intergalactic.InternalTypings.InferChildComponentProps<LegendItemIconType, typeof LegendItemRoot, 'Icon'>,\n) {\n const { styles, children: hasChildren, Children } = props;\n const SIcon = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SIcon render={Box} tag='span'>\n <Children />\n </SIcon>,\n );\n}\nIcon.displayName = 'Icon';\n\nfunction Label(\n props: Intergalactic.InternalTypings.InferChildComponentProps<LegendItemLabelType, typeof LegendItemRoot, 'Label'>,\n) {\n const { styles, children: hasChildren, Children } = props;\n const SLabel = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SLabel render={TypographyText} use='primary'>\n <Children />\n </SLabel>,\n );\n}\nLabel.displayName = 'Label';\n\nfunction AdditionalLabel(\n props: Intergalactic.InternalTypings.InferChildComponentProps<LegendItemAdditionalLabelType, typeof LegendItemRoot, 'AdditionalLabel'>,\n) {\n const { styles, children: hasChildren, Children } = props;\n const SAdditionalLabel = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SAdditionalLabel render={TypographyText} use='secondary'>\n <Children />\n </SAdditionalLabel>,\n );\n}\nAdditionalLabel.displayName = 'AdditionalLabel';\n\nfunction Count(\n props: Intergalactic.InternalTypings.InferChildComponentProps<LegendItemCountType, typeof LegendItemRoot, 'Count'>,\n) {\n const { styles, children: hasChildren, Children } = props;\n const SCount = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SCount render={TypographyText} use='secondary'>\n <Children />\n </SCount>,\n );\n}\nCount.displayName = 'Count';\n\n/**\n * LegendItemComponent\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/chart-legend/chart-legend-api/|API} | {@link https://developer.semrush.com/intergalactic/data-display/chart-legend/chart-legend-code/|Examples}\n */\nexport const LegendItemComponent = createComponent<\n LegendItemType,\n typeof LegendItemRoot\n>(LegendItemRoot, {\n Shape,\n Icon,\n Label,\n AdditionalLabel,\n Count,\n});\n"],"mapp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
15
|
opacity: 0.3;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
SCheckbox[size='m'] > span:first-of-type {
|
|
19
|
+
width: var(--intergalactic-spacing-4x, 16px);
|
|
20
|
+
height: var(--intergalactic-spacing-4x, 16px);
|
|
21
|
+
margin-top: var(--intergalactic-spacing-05x, 2px);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
SCheckbox[size='l'] > span:first-of-type {
|
|
25
|
+
width: var(--intergalactic-spacing-5x, 20px);
|
|
26
|
+
height: var(--intergalactic-spacing-5x, 20px);
|
|
27
|
+
margin-top: var(--intergalactic-spacing-05x, 2px);
|
|
28
|
+
}
|
|
29
|
+
|
|
18
30
|
SPointShape[color] {
|
|
19
31
|
background-color: var(--color);
|
|
20
32
|
margin-right: var(--intergalactic-spacing-1-5x, 6px);
|
|
@@ -12,19 +12,19 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
12
12
|
var _BaseLegend = require("../BaseLegend");
|
|
13
13
|
var _LegendItem = require("../LegendItem/LegendItem");
|
|
14
14
|
/*!__reshadow-styles__:"./legend-table.shadow.css"*/
|
|
15
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
15
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SLegendTable_yfsy1_gg_.__additions-count_yfsy1_gg_{font-feature-settings:\"tnum\";font-variant-numeric:tabular-nums;display:grid;align-items:center;grid-column-gap:var(--intergalactic-spacing-2x,8px)}.___SLegendTable_yfsy1_gg_.__additions-count_yfsy1_gg_._additions-direction_columns_yfsy1_gg_{grid-template-columns:auto repeat(var(--additions-count_yfsy1),.2fr);height:-moz-fit-content;height:fit-content;grid-row-gap:var(--intergalactic-spacing-2x,8px)}.___SLegendTable_yfsy1_gg_.__additions-count_yfsy1_gg_._additions-direction_columns_yfsy1_gg_>.___SColumnItem_yfsy1_gg_{text-align:right}.___SLegendTable_yfsy1_gg_.__additions-count_yfsy1_gg_._additions-direction_rows_yfsy1_gg_{grid-template-rows:auto repeat(var(--additions-count_yfsy1),.2fr);grid-auto-flow:column;grid-row-gap:var(--intergalactic-spacing-1x,4px);grid-column-gap:var(--intergalactic-spacing-14x,56px);grid-template-columns:repeat(var(--items-count_yfsy1),max-content)}.___SColumnItem_yfsy1_gg_{white-space:nowrap}.___SColumnItem_yfsy1_gg_._size_l_yfsy1_gg_{font-size:var(--intergalactic-fs-300,16px)}.___SColumnItem_yfsy1_gg_._size_m_yfsy1_gg_{font-size:var(--intergalactic-fs-200,14px)}.___SColumnItem_yfsy1_gg_.__transparent_yfsy1_gg_{opacity:.3}", /*__inner_css_end__*/"yfsy1_gg_"),
|
|
16
16
|
/*__reshadow_css_end__*/
|
|
17
17
|
{
|
|
18
|
-
"__SLegendTable": "
|
|
19
|
-
"_additions-count": "__additions-
|
|
20
|
-
"_additions-direction_columns": "_additions-
|
|
21
|
-
"--additions-count": "--additions-
|
|
22
|
-
"__SColumnItem": "
|
|
23
|
-
"_additions-direction_rows": "_additions-
|
|
24
|
-
"--items-count": "--items-
|
|
25
|
-
"_size_l": "
|
|
26
|
-
"_size_m": "
|
|
27
|
-
"_transparent": "
|
|
18
|
+
"__SLegendTable": "___SLegendTable_yfsy1_gg_",
|
|
19
|
+
"_additions-count": "__additions-count_yfsy1_gg_",
|
|
20
|
+
"_additions-direction_columns": "_additions-direction_columns_yfsy1_gg_",
|
|
21
|
+
"--additions-count": "--additions-count_yfsy1",
|
|
22
|
+
"__SColumnItem": "___SColumnItem_yfsy1_gg_",
|
|
23
|
+
"_additions-direction_rows": "_additions-direction_rows_yfsy1_gg_",
|
|
24
|
+
"--items-count": "--items-count_yfsy1",
|
|
25
|
+
"_size_l": "_size_l_yfsy1_gg_",
|
|
26
|
+
"_size_m": "_size_m_yfsy1_gg_",
|
|
27
|
+
"_transparent": "__transparent_yfsy1_gg_"
|
|
28
28
|
});
|
|
29
29
|
class LegendTableRoot extends _BaseLegend.BaseLegend {
|
|
30
30
|
render() {
|
|
@@ -32,7 +32,7 @@ STooltipDeltaWrapper {
|
|
|
32
32
|
justify-content: flex-end;
|
|
33
33
|
|
|
34
34
|
&[trend='upward'] {
|
|
35
|
-
color: var(--intergalactic-chart-data-success, oklch(0.
|
|
35
|
+
color: var(--intergalactic-chart-data-success, oklch(0.74 0.17 170));
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
&[trend='downward'] {
|
|
@@ -49,7 +49,7 @@ STooltipDeltaWrapper {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
&[trend='downward'] {
|
|
52
|
-
color: var(--intergalactic-chart-data-success, oklch(0.
|
|
52
|
+
color: var(--intergalactic-chart-data-success, oklch(0.74 0.17 170));
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -21,7 +21,7 @@ SLine[transparent] {
|
|
|
21
21
|
|
|
22
22
|
SNull {
|
|
23
23
|
fill: transparent;
|
|
24
|
-
stroke: var(--intergalactic-chart-
|
|
24
|
+
stroke: var(--intergalactic-chart-data-null, oklch(0.9 0.009 234));
|
|
25
25
|
stroke-dasharray: 4;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -33,7 +33,7 @@ SLineArea {
|
|
|
33
33
|
transition-property: d;
|
|
34
34
|
transition-duration: var(--duration);
|
|
35
35
|
transition-timing-function: ease-in-out;
|
|
36
|
-
opacity: 0.
|
|
36
|
+
opacity: 0.1;
|
|
37
37
|
fill: var(--intergalactic-chart-palette-order-1, oklch(0.23 0.009 245));
|
|
38
38
|
}
|
|
39
39
|
SLineArea[color] {
|
|
@@ -15,6 +15,10 @@ foreignObject[data-aria-only] {
|
|
|
15
15
|
pointer-events: none;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
SPlot:has([data-tick-content] :focus-visible) foreignObject[data-hovered-tick] {
|
|
19
|
+
visibility: hidden;
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
SPlot:has(foreignObject[data-aria-only]:focus-within) {
|
|
19
23
|
@mixin focus-outline-mixin;
|
|
20
24
|
border-radius: var(--intergalactic-surface-rounded, 8px);
|
|
@@ -6,11 +6,10 @@ SReferenceLine {
|
|
|
6
6
|
STitle {
|
|
7
7
|
font-size: var(--intergalactic-fs-100, 12px);
|
|
8
8
|
fill: var(--intergalactic-chart-grid-text-label, oklch(from oklch(0.182 0.045 244.8 / 0.593) l c h / 0.4));
|
|
9
|
-
transform-origin: var(--transform-origin);
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
STitle[position='top'] {
|
|
13
|
-
|
|
12
|
+
dominant-baseline: hanging;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
STitle[position='bottom'] {
|
|
@@ -30,14 +29,12 @@ STitle[position='left'] {
|
|
|
30
29
|
dominant-baseline: middle;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
fill: var(--fill);
|
|
32
|
+
SSubTitle {
|
|
33
|
+
font-size: var(--intergalactic-fs-100, 12px);
|
|
34
|
+
fill: var(--intergalactic-chart-grid-text-label-accent, oklch(0.102 0.021 230.9 / 0.9));
|
|
35
|
+
font-weight: bold;
|
|
38
36
|
}
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
stroke-width: 1px;
|
|
38
|
+
SBackground {
|
|
39
|
+
fill: var(--intergalactic-chart-grid-period-bg, oklch(0.96 0.005 232.5));
|
|
43
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Reference.d.js","names":[],"sources":["../../../src/types/Reference.d.ts"],"sourcesContent":["import type { UnknownProperties } from '@semcore/core';\n\nimport type { Context } from './context';\nimport type { IntergalacticD3Component } from './Plot';\n\n/** @deprecated **/\nexport interface IReferenceLineProps extends ReferenceLineProps, UnknownProperties {}\nexport type ReferenceLineProps = Context & {\n
|
|
1
|
+
{"version":3,"file":"Reference.d.js","names":[],"sources":["../../../src/types/Reference.d.ts"],"sourcesContent":["import type { UnknownProperties } from '@semcore/core';\n\nimport type { Context } from './context';\nimport type { IntergalacticD3Component } from './Plot';\n\n/** @deprecated **/\nexport interface IReferenceLineProps extends ReferenceLineProps, UnknownProperties {}\nexport type ReferenceLineProps = Context & {\n /**\n * The position of the title relative reference line\n * @default 'left'\n * @deprecated use ReferenceArea if you need a title.\n */\n position?: 'top' | 'right' | 'bottom' | 'left';\n /** Value element of data */\n value?: any;\n /**\n * Reference line title\n * @deprecated use ReferenceArea if you need title.\n */\n title?: string;\n};\n\n/** @deprecated **/\nexport interface IReferenceLineTitleProps extends ReferenceLineTitleProps, UnknownProperties {}\nexport type ReferenceLineTitleProps = Context & {\n /** The position of the axis relative reference line */\n position?: 'top' | 'right' | 'bottom' | 'left';\n /** Value element of data */\n value: any;\n};\n\n/** @deprecated **/\nexport interface IReferenceLineBackgroundProps\n extends ReferenceLineBackgroundProps,\n UnknownProperties {}\nexport type ReferenceBackgroundProps = Context & {\n /** The position relative the `value` */\n position?: 'top' | 'right' | 'bottom' | 'left';\n /** Value element of data */\n value?: any;\n /** Value of the background end */\n endValue?: number | string;\n};\n/** @deprecated use ReferenceBackgroundProps instead **/\nexport type ReferenceLineBackgroundProps = ReferenceBackgroundProps;\n\nexport type ReferenceStripesProps = Context & {\n /** The position relative the `value` */\n position?: 'top' | 'right' | 'bottom' | 'left';\n /** Value element of data */\n value?: any;\n /** Value of the background end */\n endValue?: number | string;\n};\n/**\n * @deprecated use `referenceLine` property on Chart.Line.\n */\nexport declare const ReferenceLine: IntergalacticD3Component<\n 'line',\n ReferenceLineProps,\n Context\n> & {\n /**\n * @deprecated use `referenceArea` property on Chart.Line with title property\n */\n Title: IntergalacticD3Component<'text', ReferenceLineTitleProps, Context>;\n /**\n * @deprecated use `ReferenceBackground` instead.\n */\n Background: IntergalacticD3Component<'rect', ReferenceLineBackgroundProps, Context>;\n};\n/**\n * @deprecated use `referenceArea` property on Chart.Line.\n */\nexport declare const ReferenceBackground: IntergalacticD3Component<\n 'rect',\n ReferenceLineBackgroundProps,\n Context\n>;\n/**\n * @deprecated use `referenceArea` property on Chart.Line.\n */\nexport declare const ReferenceStripes: IntergalacticD3Component<\n 'rect',\n ReferenceStripesProps,\n Context\n>;\n"],"mappings":"","ignoreList":[]}
|
package/lib/es6/Area.js
CHANGED
|
@@ -13,20 +13,20 @@ import createElement from './createElement';
|
|
|
13
13
|
import Dots from './Dots';
|
|
14
14
|
import { PatternFill, ForecastGradient, PotentialGradient, StrokeMask } from './Pattern';
|
|
15
15
|
/*!__reshadow-styles__:"./style/area.shadow.css"*/
|
|
16
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
16
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SArea_c5ur2_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));fill-opacity:.1}.___SArea_c5ur2_gg_.__withGradient_c5ur2_gg_{-webkit-mask-image:linear-gradient(180deg,#000 0,#0000007a 60%,#0000);mask-image:linear-gradient(180deg,#000 0,#0000007a 60%,#0000)}.___SArea_c5ur2_gg_.__color_c5ur2_gg_{fill:var(--color_c5ur2)}.___SArea_c5ur2_gg_.__pattern_c5ur2_gg_{fill:var(--pattern_c5ur2);fill-opacity:.5}.___SArea_c5ur2_gg_.__transparent_c5ur2_gg_{opacity:.3}.___SAreaLine_c5ur2_gg_{stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));stroke-width:2;fill:#0000}.___SAreaLine_c5ur2_gg_.__color_c5ur2_gg_{stroke:var(--color_c5ur2)}.___SAreaLine_c5ur2_gg_.__transparent_c5ur2_gg_{opacity:.3}.___SAreaLine_c5ur2_gg_,.___SArea_c5ur2_gg_{transition-property:d;transition-duration:var(--duration_c5ur2);transition-timing-function:ease-in-out}.___SNull_c5ur2_gg_{fill:#0000;stroke:var(--intergalactic-chart-data-null,oklch(.9 .009 234));stroke-dasharray:4}.___SNull_c5ur2_gg_.__hide_c5ur2_gg_{display:none}", /*__inner_css_end__*/"c5ur2_gg_"),
|
|
17
17
|
/*__reshadow_css_end__*/
|
|
18
18
|
{
|
|
19
|
-
"__SArea": "
|
|
20
|
-
"_withGradient": "
|
|
21
|
-
"_color": "
|
|
22
|
-
"--color": "--
|
|
23
|
-
"_pattern": "
|
|
24
|
-
"--pattern": "--
|
|
25
|
-
"_transparent": "
|
|
26
|
-
"__SAreaLine": "
|
|
27
|
-
"--duration": "--
|
|
28
|
-
"__SNull": "
|
|
29
|
-
"_hide": "
|
|
19
|
+
"__SArea": "___SArea_c5ur2_gg_",
|
|
20
|
+
"_withGradient": "__withGradient_c5ur2_gg_",
|
|
21
|
+
"_color": "__color_c5ur2_gg_",
|
|
22
|
+
"--color": "--color_c5ur2",
|
|
23
|
+
"_pattern": "__pattern_c5ur2_gg_",
|
|
24
|
+
"--pattern": "--pattern_c5ur2",
|
|
25
|
+
"_transparent": "__transparent_c5ur2_gg_",
|
|
26
|
+
"__SAreaLine": "___SAreaLine_c5ur2_gg_",
|
|
27
|
+
"--duration": "--duration_c5ur2",
|
|
28
|
+
"__SNull": "___SNull_c5ur2_gg_",
|
|
29
|
+
"_hide": "__hide_c5ur2_gg_"
|
|
30
30
|
});
|
|
31
31
|
import { definedData, scaleOfBandwidth, getNullData, definedNullData, interpolateValue, eventToPoint, invert, getDataOfType } from './utils';
|
|
32
32
|
class AreaRoot extends Component {
|
package/lib/es6/Axis.js
CHANGED
|
@@ -8,23 +8,23 @@ import useEnhancedEffect from '@semcore/core/lib/utils/use/useEnhancedEffect';
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import createElement from './createElement';
|
|
10
10
|
/*!__reshadow-styles__:"./style/axis.shadow.css"*/
|
|
11
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
11
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SAxis_1aio5_gg_{stroke:var(--intergalactic-chart-grid-x-axis,oklch(.88 .011 234.9))}.___SAxis_1aio5_gg_.__hide_1aio5_gg_{display:none}.___STick_1aio5_gg_{display:block;font-size:var(--intergalactic-fs-100,12px);font-feature-settings:\"tnum\";font-variant-numeric:tabular-nums;line-height:var(--intergalactic-lh-100,1.3334);color:var(--intergalactic-chart-grid-text-label,#00132466);overflow:visible}.___STick_1aio5_gg_ [data-tick-content]{height:100%}.___STick_1aio5_gg_._position_bottom_1aio5_gg_{text-align:center}.___STick_1aio5_gg_._position_left_1aio5_gg_{text-align:right;dominant-baseline:central}.___STick_1aio5_gg_._position_left_1aio5_gg_ [data-tick-content]{align-content:center}.___STick_1aio5_gg_._position_top_1aio5_gg_{text-align:center}.___STick_1aio5_gg_._position_top_1aio5_gg_ [data-tick-content]{align-content:end}.___STick_1aio5_gg_._position_right_1aio5_gg_{dominant-baseline:central}.___STick_1aio5_gg_._position_right_1aio5_gg_ [data-tick-content]{align-content:center}.___STick_1aio5_gg_.__hide_1aio5_gg_{display:none}.___STick_1aio5_gg_.__primaryText_1aio5_gg_{color:var(--intergalactic-text-primary,oklch(.23 .009 245))}.___SGrid_1aio5_gg_{fill:#0000;stroke:var(--intergalactic-chart-grid-line,oklch(.7 .021 242));stroke-dasharray:0 6;stroke-linecap:round}.___STitle_1aio5_gg_{font-size:var(--intergalactic-fs-100,12px);fill:var(--intergalactic-chart-grid-text-label,#00132466);transform-origin:var(--transform-origin_1aio5)}.___STitle_1aio5_gg_._position_top_1aio5_gg_{text-anchor:middle}.___STitle_1aio5_gg_._position_bottom_1aio5_gg_{text-anchor:middle;dominant-baseline:hanging}.___STitle_1aio5_gg_._position_left_1aio5_gg_,.___STitle_1aio5_gg_._position_right_1aio5_gg_{transform:rotate(-90deg);dominant-baseline:middle;text-anchor:middle}.___STitle_1aio5_gg_._position_left_1aio5_gg_.__verticalWritingMode_1aio5_gg_,.___STitle_1aio5_gg_._position_right_1aio5_gg_.__verticalWritingMode_1aio5_gg_{writing-mode:vertical-rl;transform:none}.___STick_1aio5_gg_._position_custom_0_1aio5_gg_{transform:translateY(12px);text-anchor:middle;dominant-baseline:hanging}.___STick_1aio5_gg_._position_custom_0_1aio5_gg_ tspan{dominant-baseline:hanging}.___STick_1aio5_gg_._position_custom_1_1aio5_gg_{transform:translateX(-16px);text-anchor:end;dominant-baseline:middle}.___STick_1aio5_gg_._position_custom_1_1aio5_gg_ tspan{dominant-baseline:middle}", /*__inner_css_end__*/"1aio5_gg_"),
|
|
12
12
|
/*__reshadow_css_end__*/
|
|
13
13
|
{
|
|
14
|
-
"__SAxis": "
|
|
15
|
-
"_hide": "
|
|
16
|
-
"__SGrid": "
|
|
17
|
-
"__STitle": "
|
|
18
|
-
"--transform-origin": "--transform-
|
|
19
|
-
"_position_top": "
|
|
20
|
-
"_position_bottom": "
|
|
21
|
-
"_position_right": "
|
|
22
|
-
"_position_left": "
|
|
23
|
-
"_verticalWritingMode": "
|
|
24
|
-
"__STick": "
|
|
25
|
-
"_primaryText": "
|
|
26
|
-
"_position_custom_0": "
|
|
27
|
-
"_position_custom_1": "
|
|
14
|
+
"__SAxis": "___SAxis_1aio5_gg_",
|
|
15
|
+
"_hide": "__hide_1aio5_gg_",
|
|
16
|
+
"__SGrid": "___SGrid_1aio5_gg_",
|
|
17
|
+
"__STitle": "___STitle_1aio5_gg_",
|
|
18
|
+
"--transform-origin": "--transform-origin_1aio5",
|
|
19
|
+
"_position_top": "_position_top_1aio5_gg_",
|
|
20
|
+
"_position_bottom": "_position_bottom_1aio5_gg_",
|
|
21
|
+
"_position_right": "_position_right_1aio5_gg_",
|
|
22
|
+
"_position_left": "_position_left_1aio5_gg_",
|
|
23
|
+
"_verticalWritingMode": "__verticalWritingMode_1aio5_gg_",
|
|
24
|
+
"__STick": "___STick_1aio5_gg_",
|
|
25
|
+
"_primaryText": "__primaryText_1aio5_gg_",
|
|
26
|
+
"_position_custom_0": "_position_custom_0_1aio5_gg_",
|
|
27
|
+
"_position_custom_1": "_position_custom_1_1aio5_gg_"
|
|
28
28
|
});
|
|
29
29
|
import { scaleOfBandwidth } from './utils';
|
|
30
30
|
const TICK_MARGIN_X = 16;
|