@semcore/mini-chart 0.30.0-prerelease.0 → 0.30.0-prerelease.4

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.
Files changed (58) hide show
  1. package/lib/cjs/component/score/Donut.js +64 -60
  2. package/lib/cjs/component/score/Donut.js.map +1 -1
  3. package/lib/cjs/component/score/Line.js +41 -38
  4. package/lib/cjs/component/score/Line.js.map +1 -1
  5. package/lib/cjs/component/score/Line.types.js.map +1 -1
  6. package/lib/cjs/component/score/Score.js.map +1 -1
  7. package/lib/cjs/component/score/index.js.map +1 -1
  8. package/lib/cjs/component/score/line.shadow.css +1 -1
  9. package/lib/cjs/component/trend/Bar.js +28 -22
  10. package/lib/cjs/component/trend/Bar.js.map +1 -1
  11. package/lib/cjs/component/trend/Line.js +26 -20
  12. package/lib/cjs/component/trend/Line.js.map +1 -1
  13. package/lib/cjs/component/trend/Trend.js +13 -9
  14. package/lib/cjs/component/trend/Trend.js.map +1 -1
  15. package/lib/cjs/component/trend/index.js +1 -1
  16. package/lib/cjs/component/trend/index.js.map +1 -1
  17. package/lib/cjs/index.js +2 -1
  18. package/lib/cjs/index.js.map +1 -1
  19. package/lib/es6/component/score/Donut.js +58 -57
  20. package/lib/es6/component/score/Donut.js.map +1 -1
  21. package/lib/es6/component/score/Line.js +31 -31
  22. package/lib/es6/component/score/Line.js.map +1 -1
  23. package/lib/es6/component/score/Line.types.js.map +1 -1
  24. package/lib/es6/component/score/Score.js.map +1 -1
  25. package/lib/es6/component/score/index.js.map +1 -1
  26. package/lib/es6/component/score/line.shadow.css +1 -1
  27. package/lib/es6/component/trend/Bar.js +21 -19
  28. package/lib/es6/component/trend/Bar.js.map +1 -1
  29. package/lib/es6/component/trend/Line.js +19 -17
  30. package/lib/es6/component/trend/Line.js.map +1 -1
  31. package/lib/es6/component/trend/Trend.js +10 -7
  32. package/lib/es6/component/trend/Trend.js.map +1 -1
  33. package/lib/es6/component/trend/index.js +1 -1
  34. package/lib/es6/component/trend/index.js.map +1 -1
  35. package/lib/es6/index.js.map +1 -1
  36. package/lib/esm/component/score/Donut.mjs +61 -58
  37. package/lib/esm/component/score/Line.mjs +37 -35
  38. package/lib/esm/component/score/line.shadow.css +1 -1
  39. package/lib/esm/component/trend/Bar.mjs +23 -20
  40. package/lib/esm/component/trend/Line.mjs +23 -20
  41. package/lib/esm/component/trend/Trend.mjs +12 -9
  42. package/lib/esm/index.mjs +3 -5
  43. package/lib/types/component/score/Donut.d.ts +11 -8
  44. package/lib/types/component/score/Line.d.ts +1 -1
  45. package/lib/types/component/score/Line.types.d.ts +9 -11
  46. package/lib/types/component/trend/Bar.d.ts +9 -3
  47. package/lib/types/component/trend/Line.d.ts +11 -7
  48. package/lib/types/component/trend/Trend.d.ts +4 -4
  49. package/lib/types/component/trend/index.d.ts +1 -1
  50. package/package.json +4 -4
  51. package/lib/cjs/utils/ScoreDonutUtils.js +0 -87
  52. package/lib/cjs/utils/ScoreDonutUtils.js.map +0 -1
  53. package/lib/es6/utils/ScoreDonutUtils.js +0 -80
  54. package/lib/es6/utils/ScoreDonutUtils.js.map +0 -1
  55. package/lib/esm/component/score/index.mjs +0 -7
  56. package/lib/esm/component/trend/index.mjs +0 -8
  57. package/lib/esm/utils/ScoreDonutUtils.mjs +0 -82
  58. package/lib/types/utils/ScoreDonutUtils.d.ts +0 -18
@@ -1,101 +1,104 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/esm/createClass";
4
- import _callSuper from "@babel/runtime/helpers/esm/callSuper";
5
4
  import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
6
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
- import { sstyled, assignProps, Component, createComponent } from "@semcore/core";
8
- import { Box } from "@semcore/base-components";
9
- import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
10
- import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
11
- import { cssVariableEnhance } from "@semcore/core/lib/utils/useCssVariable";
7
+ import { sstyled } from "@semcore/utils/lib/core/index";
8
+ import createComponent, { assignProps, sstyled as sstyled$1, Component } from "@semcore/core";
12
9
  import React from "react";
13
- import { ScoreDonutUtils } from "../../utils/ScoreDonutUtils.mjs";
10
+ import { Box } from "@semcore/flex-box";
11
+ import resolveColorEnhance from "@semcore/utils/lib/enhances/resolveColorEnhance";
12
+ import { extractAriaProps } from "@semcore/utils/lib/ariaProps";
14
13
  /*!__reshadow-styles__:"./donut.shadow.css"*/
15
14
  var style = (
16
15
  /*__reshadow_css_start__*/
17
16
  (sstyled.insert(
18
17
  /*__inner_css_start__*/
19
- "@keyframes pulse_w54vj{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_w54vj_gg_.__loading_w54vj_gg_,.___SLineGauge_w54vj_gg_.__loading_w54vj_gg_,.___STrendBar_w54vj_gg_.__loading_w54vj_gg_,.___STrendLine_w54vj_gg_.__loading_w54vj_gg_{animation-name:pulse_w54vj;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SDonutContainer_w54vj_gg_.__semi_w54vj_gg_ g{transform:rotate(180deg) translate(-24px,-24px)}.___SDonutContainer_w54vj_gg_ g{transform:rotate(-90deg) translate(-24px)}.___SDonutContainer_w54vj_gg_.__animate_w54vj_gg_ circle{transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out}",
18
+ "@keyframes pulse_1clki{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1clki_gg_.__loading_1clki_gg_,.___SLineGauge_1clki_gg_.__loading_1clki_gg_,.___STrendBar_1clki_gg_.__loading_1clki_gg_,.___STrendLine_1clki_gg_.__loading_1clki_gg_{animation-name:pulse_1clki;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SDonutContainer_1clki_gg_.__semi_1clki_gg_ g{transform:rotate(180deg) translate(-24px,-24px)}.___SDonutContainer_1clki_gg_ g{transform:rotate(-90deg) translate(-24px)}.___SDonutContainer_1clki_gg_.__animate_1clki_gg_ circle{transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out}",
20
19
  /*__inner_css_end__*/
21
- "w54vj_gg_"
20
+ "1clki_gg_"
22
21
  ), /*__reshadow_css_end__*/
23
22
  {
24
- "__SLineGauge": "___SLineGauge_w54vj_gg_",
25
- "_loading": "__loading_w54vj_gg_",
26
- "__SDonutContainer": "___SDonutContainer_w54vj_gg_",
27
- "__STrendLine": "___STrendLine_w54vj_gg_",
28
- "__STrendBar": "___STrendBar_w54vj_gg_",
29
- "@pulse": "pulse_w54vj",
30
- "_animate": "__animate_w54vj_gg_",
31
- "_semi": "__semi_w54vj_gg_"
23
+ "__SLineGauge": "___SLineGauge_1clki_gg_",
24
+ "_loading": "__loading_1clki_gg_",
25
+ "__SDonutContainer": "___SDonutContainer_1clki_gg_",
26
+ "__STrendLine": "___STrendLine_1clki_gg_",
27
+ "__STrendBar": "___STrendBar_1clki_gg_",
28
+ "@pulse": "pulse_1clki",
29
+ "_animate": "__animate_1clki_gg_",
30
+ "_semi": "__semi_1clki_gg_"
32
31
  })
33
32
  );
34
- var DonutRoot = /* @__PURE__ */ (function(_Component) {
33
+ var DonutRoot = /* @__PURE__ */ function(_Component) {
34
+ _inherits(DonutRoot2, _Component);
35
+ var _super = _createSuper(DonutRoot2);
35
36
  function DonutRoot2() {
36
37
  _classCallCheck(this, DonutRoot2);
37
- return _callSuper(this, DonutRoot2, arguments);
38
+ return _super.apply(this, arguments);
38
39
  }
39
- _inherits(DonutRoot2, _Component);
40
- return _createClass(DonutRoot2, [{
40
+ _createClass(DonutRoot2, [{
41
41
  key: "render",
42
42
  value: function render() {
43
43
  var _ref = this.asProps, _ref2;
44
44
  var SDonutContainer = Box;
45
- var _this$asProps = this.asProps, value = _this$asProps.value, styles = _this$asProps.styles, _this$asProps$baseBgC = _this$asProps.baseBgColor, baseBgColor = _this$asProps$baseBgC === void 0 ? "chart-grid-bar-chart-base-bg" : _this$asProps$baseBgC, _this$asProps$color = _this$asProps.color, color = _this$asProps$color === void 0 ? "chart-palette-order-1" : _this$asProps$color, resolveColor = _this$asProps.resolveColor, isSemiDonut = _this$asProps.isSemiDonut, loading = _this$asProps.loading, animate = _this$asProps.animate, duration = _this$asProps.duration;
46
- var scoreDonut = new ScoreDonutUtils(value, isSemiDonut);
45
+ var _this$asProps = this.asProps, value = _this$asProps.value, styles = _this$asProps.styles, _this$asProps$baseBgC = _this$asProps.baseBgColor, baseBgColor = _this$asProps$baseBgC === void 0 ? "chart-grid-bar-chart-base-bg" : _this$asProps$baseBgC, _this$asProps$color = _this$asProps.color, color = _this$asProps$color === void 0 ? "chart-palette-order-1" : _this$asProps$color, resolveColor = _this$asProps.resolveColor, isSemiDonut = _this$asProps.isSemiDonut, loading = _this$asProps.loading;
46
+ var strokeWidth = isSemiDonut ? 6 : 4;
47
+ var radius = isSemiDonut ? 9 : 10;
48
+ var baseStrokeDasharray = isSemiDonut ? Math.PI * radius : Math.PI * 2 * radius;
49
+ var valueStrokeDasharray = baseStrokeDasharray * (value / 100);
50
+ var greyStrokeDasharray = baseStrokeDasharray * ((100 - value) / 100);
51
+ var offsetPoint = isSemiDonut ? baseStrokeDasharray / (100 / 3) : baseStrokeDasharray / 100;
52
+ var strokeDasharrayBetweenSpaces = "".concat(greyStrokeDasharray - 2 * offsetPoint, " ").concat(offsetPoint);
53
+ var spaceStrokeDasharray = "".concat(offsetPoint, " ").concat(value < 99 ? "".concat(strokeDasharrayBetweenSpaces) : "", " ").concat(baseStrokeDasharray);
54
+ if (isSemiDonut) {
55
+ spaceStrokeDasharray = "".concat(offsetPoint, " ").concat(value < 95 ? "".concat(strokeDasharrayBetweenSpaces) : "", " ").concat(baseStrokeDasharray);
56
+ }
57
+ var viewBox = isSemiDonut ? "0 0 24 12" : "0 0 24 24";
58
+ var strokeDashoffsetBase = -1 * (valueStrokeDasharray + (isSemiDonut ? offsetPoint : 0));
47
59
  var _extractAriaProps = extractAriaProps(this.asProps), __excludeProps = _extractAriaProps.__excludeProps, extractedAriaProps = _extractAriaProps.extractedAriaProps;
48
- return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SDonutContainer, _ref2.cn("SDonutContainer", _objectSpread({}, assignProps({
60
+ return _ref2 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SDonutContainer, _ref2.cn("SDonutContainer", _objectSpread({}, assignProps({
49
61
  "semi": isSemiDonut,
50
62
  "__excludeProps": __excludeProps
51
63
  }, _ref))), /* @__PURE__ */ React.createElement("svg", _ref2.cn("svg", _objectSpread({
52
64
  "width": "100%",
53
65
  "height": "100%",
54
- "viewBox": scoreDonut.viewBox,
66
+ "viewBox": viewBox,
55
67
  "fill": "none",
56
68
  "role": "img"
57
69
  }, extractedAriaProps)), /* @__PURE__ */ React.createElement("g", _ref2.cn("g", {}), /* @__PURE__ */ React.createElement("circle", _ref2.cn("circle", {
58
70
  "cx": "12",
59
71
  "cy": "12",
60
- "r": scoreDonut.radius,
61
- "strokeWidth": scoreDonut.strokeWidth,
72
+ "r": radius,
73
+ "strokeWidth": strokeWidth,
62
74
  "stroke": resolveColor(baseBgColor),
63
- "strokeDasharray": loading ? void 0 : "".concat(scoreDonut.baseLength, " ").concat(scoreDonut.fullLength),
64
- "strokeDashoffset": scoreDonut.baseOffset
65
- }), animate && value > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("animate", _ref2.cn("animate", {
66
- "attributeName": "stroke-dasharray",
67
- "from": "".concat(scoreDonut.animatedBaseLengthFrom, " ").concat(scoreDonut.fullLength),
68
- "to": "".concat(scoreDonut.animatedBaseLengthTo, " ").concat(scoreDonut.fullLength),
69
- "dur": duration + "ms"
70
- })), /* @__PURE__ */ React.createElement("animate", _ref2.cn("animate", {
71
- "attributeName": "stroke-dashoffset",
72
- "from": -1 * scoreDonut.startMargin,
73
- "to": scoreDonut.baseOffset,
74
- "dur": duration + "ms"
75
- })))), !loading && value > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("circle", _ref2.cn("circle", {
75
+ "strokeDasharray": loading ? void 0 : "".concat(greyStrokeDasharray, " ").concat(baseStrokeDasharray),
76
+ "strokeDashoffset": strokeDashoffsetBase
77
+ })), !loading && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("circle", _ref2.cn("circle", {
76
78
  "cx": "12",
77
79
  "cy": "12",
78
- "r": scoreDonut.radius,
79
- "strokeWidth": scoreDonut.strokeWidth,
80
+ "r": radius,
81
+ "strokeWidth": strokeWidth,
80
82
  "stroke": resolveColor(color),
81
- "strokeDasharray": "".concat(scoreDonut.valueLength, " ").concat(scoreDonut.fullLength)
82
- }), animate && /* @__PURE__ */ React.createElement("animate", _ref2.cn("animate", {
83
- "attributeName": "stroke-dasharray",
84
- "from": "0 ".concat(scoreDonut.fullLength),
85
- "to": "".concat(scoreDonut.valueLength, " ").concat(scoreDonut.fullLength),
86
- "dur": duration + "ms"
87
- })))))));
83
+ "strokeDasharray": "".concat(valueStrokeDasharray, " ").concat(baseStrokeDasharray),
84
+ "strokeDashoffset": valueStrokeDasharray
85
+ }), /* @__PURE__ */ React.createElement("animate", _ref2.cn("animate", {
86
+ "attributeName": "stroke-dashoffset",
87
+ "values": "0;".concat(valueStrokeDasharray)
88
+ }))), value !== 100 && !isSemiDonut && /* @__PURE__ */ React.createElement("circle", _ref2.cn("circle", {
89
+ "cx": "12",
90
+ "cy": "12",
91
+ "r": radius,
92
+ "strokeWidth": strokeWidth,
93
+ "stroke": resolveColor("chart-grid-border"),
94
+ "strokeDasharray": spaceStrokeDasharray,
95
+ "strokeDashoffset": -1 * valueStrokeDasharray
96
+ }))))));
88
97
  }
89
98
  }]);
90
- })(Component);
91
- _defineProperty(DonutRoot, "enhance", [cssVariableEnhance({
92
- variable: "--intergalactic-duration-extra-slow",
93
- fallback: "500",
94
- map: function map(v) {
95
- return Number.parseInt(v, 10).toString();
96
- },
97
- prop: "duration"
98
- }), resolveColorEnhance()]);
99
+ return DonutRoot2;
100
+ }(Component);
101
+ _defineProperty(DonutRoot, "enhance", [resolveColorEnhance()]);
99
102
  _defineProperty(DonutRoot, "style", style);
100
103
  _defineProperty(DonutRoot, "defaultProps", {
101
104
  animate: true
@@ -1,49 +1,51 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/esm/createClass";
4
- import _callSuper from "@babel/runtime/helpers/esm/callSuper";
5
4
  import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
6
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
- import { sstyled, assignProps, Component, createComponent } from "@semcore/core";
8
- import { Box, Flex } from "@semcore/base-components";
9
- import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
7
+ import { sstyled } from "@semcore/utils/lib/core/index";
8
+ import createComponent, { sstyled as sstyled$1, assignProps, Component } from "@semcore/core";
10
9
  import React from "react";
10
+ import { Box, Flex } from "@semcore/flex-box";
11
+ import resolveColorEnhance from "@semcore/utils/lib/enhances/resolveColorEnhance";
11
12
  /*!__reshadow-styles__:"./line.shadow.css"*/
12
13
  var style = (
13
14
  /*__reshadow_css_start__*/
14
15
  (sstyled.insert(
15
16
  /*__inner_css_start__*/
16
- "@keyframes pulse_776hj{0%,to{opacity:1}50%{opacity:.4}}@keyframes move-line_776hj{0%{transform:translateX(0)}to{transform:translateX(100%)}}.___SDonutContainer_776hj_gg_.__loading_776hj_gg_,.___SLineGauge_776hj_gg_.__loading_776hj_gg_,.___STrendBar_776hj_gg_.__loading_776hj_gg_,.___STrendLine_776hj_gg_.__loading_776hj_gg_{animation-name:pulse_776hj;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SLineGauge_776hj_gg_{height:8px;background-color:var(--base-bg-color_776hj, var(--intergalactic-chart-grid-bar-chart-base-bg, rgb(241, 242, 242)));border-radius:var(--intergalactic-chart-rounded, 2px);overflow:hidden;position:relative}.___SLineValue_776hj_gg_{height:8px;border-radius:var(--intergalactic-chart-rounded, 2px)0 0 var(--intergalactic-chart-rounded, 2px)}.___SLineValue_776hj_gg_.__percent_776hj_gg_{width:var(--percent_776hj)}.___SLineSegmentItem_776hj_gg_.__color_776hj_gg_,.___SLineValue_776hj_gg_.__color_776hj_gg_{background-color:var(--color_776hj, var(--intergalactic-chart-palette-order-1, rgb(104, 109, 210)))}.___SLineGauge_776hj_gg_.__segments_776hj_gg_{border-radius:var(--intergalactic-progress-bar-rounded, 6px)}.___SAnimationLine_776hj_gg_,.___SLineGaugeSegment_776hj_gg_{position:absolute;top:0;left:0;right:0;bottom:0}.___SLineSegmentItem_776hj_gg_:last-child{margin-right:0;border-right:none}.___SLineSegmentItem_776hj_gg_{height:8px;background:0 0;border-right-color:var(--intergalactic-chart-grid-border, #fff);border-right-style:solid;border-right-width:1px;box-sizing:content-box}.___SAnimationLine_776hj_gg_{background-color:var(--intergalactic-chart-grid-bar-chart-base-bg, rgb(241, 242, 242));transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out;animation-name:move-line_776hj;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}",
17
+ "@keyframes pulse_1we5b{0%,to{opacity:1}50%{opacity:.4}}@keyframes move-line_1we5b{0%{transform:translateX(0)}to{transform:translateX(100%)}}.___SDonutContainer_1we5b_gg_.__loading_1we5b_gg_,.___SLineGauge_1we5b_gg_.__loading_1we5b_gg_,.___STrendBar_1we5b_gg_.__loading_1we5b_gg_,.___STrendLine_1we5b_gg_.__loading_1we5b_gg_{animation-name:pulse_1we5b;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}.___SLineGauge_1we5b_gg_{height:8px;background-color:var(--base-bg-color_1we5b, var(--intergalactic-chart-grid-bar-chart-base-bg, rgb(241, 242, 242)));border-radius:var(--intergalactic-chart-rounded, 2px);overflow:hidden;position:relative}.___SLineValue_1we5b_gg_{height:8px;border-radius:var(--intergalactic-chart-rounded, 2px)0 0 var(--intergalactic-chart-rounded, 2px)}.___SLineValue_1we5b_gg_.__percent_1we5b_gg_{width:var(--percent_1we5b)}.___SLineSegmentItem_1we5b_gg_.__color_1we5b_gg_,.___SLineValue_1we5b_gg_.__color_1we5b_gg_{background-color:var(--color_1we5b, var(--intergalactic-chart-palette-order-1, rgb(102, 107, 219)))}.___SLineGauge_1we5b_gg_.__segments_1we5b_gg_{border-radius:var(--intergalactic-progress-bar-rounded, 6px)}.___SAnimationLine_1we5b_gg_,.___SLineGaugeSegment_1we5b_gg_{position:absolute;top:0;left:0;right:0;bottom:0}.___SLineSegmentItem_1we5b_gg_:last-child{margin-right:0;border-right:none}.___SLineSegmentItem_1we5b_gg_{height:8px;background:0 0;border-right-color:var(--intergalactic-chart-grid-border, #fff);border-right-style:solid;border-right-width:1px;box-sizing:content-box}.___SAnimationLine_1we5b_gg_{background-color:var(--intergalactic-chart-grid-bar-chart-base-bg, rgb(241, 242, 242));transition:all var(--intergalactic-duration-extra-slow, 500) ease-in-out;animation-name:move-line_1we5b;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}",
17
18
  /*__inner_css_end__*/
18
- "776hj_gg_"
19
+ "1we5b_gg_"
19
20
  ), /*__reshadow_css_end__*/
20
21
  {
21
- "__SLineGauge": "___SLineGauge_776hj_gg_",
22
- "_loading": "__loading_776hj_gg_",
23
- "__SDonutContainer": "___SDonutContainer_776hj_gg_",
24
- "__STrendLine": "___STrendLine_776hj_gg_",
25
- "__STrendBar": "___STrendBar_776hj_gg_",
26
- "@pulse": "pulse_776hj",
27
- "__SLineValue": "___SLineValue_776hj_gg_",
28
- "_percent": "__percent_776hj_gg_",
29
- "--percent": "--percent_776hj",
30
- "_color": "__color_776hj_gg_",
31
- "__SLineSegmentItem": "___SLineSegmentItem_776hj_gg_",
32
- "_segments": "__segments_776hj_gg_",
33
- "__SLineGaugeSegment": "___SLineGaugeSegment_776hj_gg_",
34
- "__SAnimationLine": "___SAnimationLine_776hj_gg_",
35
- "@move-line": "move-line_776hj",
36
- "--base-bg-color": "--base-bg-color_776hj",
37
- "--color": "--color_776hj"
22
+ "__SLineGauge": "___SLineGauge_1we5b_gg_",
23
+ "_loading": "__loading_1we5b_gg_",
24
+ "__SDonutContainer": "___SDonutContainer_1we5b_gg_",
25
+ "__STrendLine": "___STrendLine_1we5b_gg_",
26
+ "__STrendBar": "___STrendBar_1we5b_gg_",
27
+ "@pulse": "pulse_1we5b",
28
+ "__SLineValue": "___SLineValue_1we5b_gg_",
29
+ "_percent": "__percent_1we5b_gg_",
30
+ "--percent": "--percent_1we5b",
31
+ "_color": "__color_1we5b_gg_",
32
+ "__SLineSegmentItem": "___SLineSegmentItem_1we5b_gg_",
33
+ "_segments": "__segments_1we5b_gg_",
34
+ "__SLineGaugeSegment": "___SLineGaugeSegment_1we5b_gg_",
35
+ "__SAnimationLine": "___SAnimationLine_1we5b_gg_",
36
+ "@move-line": "move-line_1we5b",
37
+ "--base-bg-color": "--base-bg-color_1we5b",
38
+ "--color": "--color_1we5b"
38
39
  })
39
40
  );
40
- var LineRoot = /* @__PURE__ */ (function(_Component) {
41
+ var LineRoot = /* @__PURE__ */ function(_Component) {
42
+ _inherits(LineRoot2, _Component);
43
+ var _super = _createSuper(LineRoot2);
41
44
  function LineRoot2() {
42
45
  _classCallCheck(this, LineRoot2);
43
- return _callSuper(this, LineRoot2, arguments);
46
+ return _super.apply(this, arguments);
44
47
  }
45
- _inherits(LineRoot2, _Component);
46
- return _createClass(LineRoot2, [{
48
+ _createClass(LineRoot2, [{
47
49
  key: "getSegmentProps",
48
50
  value: function getSegmentProps(segmentProps) {
49
51
  var _this$asProps = this.asProps, children = _this$asProps.children, resolveColor = _this$asProps.resolveColor;
@@ -55,7 +57,7 @@ var LineRoot = /* @__PURE__ */ (function(_Component) {
55
57
  });
56
58
  var width = sum > 0 ? 100 * segmentProps.value / sum : 0;
57
59
  return {
58
- "w": "".concat(width, "%"),
60
+ w: "".concat(width, "%"),
59
61
  "use:color": resolveColor(segmentProps.color)
60
62
  };
61
63
  }
@@ -71,7 +73,7 @@ var LineRoot = /* @__PURE__ */ (function(_Component) {
71
73
  var _this$asProps2 = this.asProps, value = _this$asProps2.value, styles = _this$asProps2.styles, _this$asProps2$color = _this$asProps2.color, color = _this$asProps2$color === void 0 ? "chart-palette-order-1" : _this$asProps2$color, baseBgColor = _this$asProps2.baseBgColor, resolveColor = _this$asProps2.resolveColor, loading = _this$asProps2.loading, children = _this$asProps2.children, Children = _this$asProps2.Children, animate = _this$asProps2.animate;
72
74
  if (children !== void 0) {
73
75
  var _ref3;
74
- return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineGauge, _ref3.cn("SLineGauge", _objectSpread({}, assignProps({
76
+ return _ref3 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SLineGauge, _ref3.cn("SLineGauge", _objectSpread({}, assignProps({
75
77
  "segments": true,
76
78
  "base-bg-color": resolveColor(baseBgColor)
77
79
  }, _ref))), /* @__PURE__ */ React.createElement(SLineGaugeSegment, _ref3.cn("SLineGaugeSegment", {}), /* @__PURE__ */ React.createElement(Children, _ref3.cn("Children", {}))), animate && /* @__PURE__ */ React.createElement(SAnimationLine, _ref3.cn("SAnimationLine", {})));
@@ -82,7 +84,7 @@ var LineRoot = /* @__PURE__ */ (function(_Component) {
82
84
  for (var i = 0; i < segments; i++) {
83
85
  var _ref4;
84
86
  var width = "calc((100% - ".concat(segments - 1, "px) / ").concat(segments, ")");
85
- SegmentItems.push((_ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineSegmentItem, _ref4.cn("SLineSegmentItem", {
87
+ SegmentItems.push((_ref4 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SLineSegmentItem, _ref4.cn("SLineSegmentItem", {
86
88
  "key": i,
87
89
  "color": i < value ? resolveColor(color) : void 0,
88
90
  "w": width
@@ -93,7 +95,7 @@ var LineRoot = /* @__PURE__ */ (function(_Component) {
93
95
  if (segments) {
94
96
  percent = "".concat(value / segments * 100, "%");
95
97
  }
96
- return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineGauge, _ref5.cn("SLineGauge", _objectSpread({}, assignProps({
98
+ return _ref5 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SLineGauge, _ref5.cn("SLineGauge", _objectSpread({}, assignProps({
97
99
  "base-bg-color": resolveColor(baseBgColor)
98
100
  }, _ref))), !loading && /* @__PURE__ */ React.createElement(SLineValue, _ref5.cn("SLineValue", {
99
101
  "w": percent,
@@ -101,7 +103,8 @@ var LineRoot = /* @__PURE__ */ (function(_Component) {
101
103
  })), Boolean(SegmentItems.length) && /* @__PURE__ */ React.createElement(SLineGaugeSegment, _ref5.cn("SLineGaugeSegment", {}), SegmentItems), animate && /* @__PURE__ */ React.createElement(SAnimationLine, _ref5.cn("SAnimationLine", {})));
102
104
  }
103
105
  }]);
104
- })(Component);
106
+ return LineRoot2;
107
+ }(Component);
105
108
  _defineProperty(LineRoot, "enhance", [resolveColorEnhance()]);
106
109
  _defineProperty(LineRoot, "displayName", "ScoreLine");
107
110
  _defineProperty(LineRoot, "style", style);
@@ -110,10 +113,9 @@ _defineProperty(LineRoot, "defaultProps", {
110
113
  });
111
114
  function Segment(props) {
112
115
  var _ref2 = arguments[0], _ref6;
113
- var styles = props.styles, value = props.value;
116
+ var styles = props.styles;
114
117
  var SLineSegmentItem = Box;
115
- if (!value) return null;
116
- return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SLineSegmentItem, _ref6.cn("SLineSegmentItem", _objectSpread({}, assignProps({}, _ref2))));
118
+ return _ref6 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SLineSegmentItem, _ref6.cn("SLineSegmentItem", _objectSpread({}, assignProps({}, _ref2))));
117
119
  }
118
120
  Segment.displayName = "Segment";
119
121
  var ScoreLine = createComponent(LineRoot, {
@@ -18,7 +18,7 @@ SLineValue[percent] {
18
18
  }
19
19
 
20
20
  SLineValue[color], SLineSegmentItem[color] {
21
- background-color: var(--color, var(--intergalactic-chart-palette-order-1, oklch(0.58 0.153 278.4)));
21
+ background-color: var(--color, var(--intergalactic-chart-palette-order-1, oklch(0.58 0.168 278.2)));
22
22
  }
23
23
 
24
24
  SLineGauge[segments] {
@@ -2,40 +2,42 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
3
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/esm/createClass";
5
- import _callSuper from "@babel/runtime/helpers/esm/callSuper";
6
5
  import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
7
7
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
- import { sstyled, assignProps, createComponent } from "@semcore/core";
9
- import { Box } from "@semcore/base-components";
10
- import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
11
- import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
8
+ import { sstyled } from "@semcore/utils/lib/core/index";
9
+ import createComponent, { assignProps, sstyled as sstyled$1 } from "@semcore/core";
12
10
  import React from "react";
11
+ import resolveColorEnhance from "@semcore/utils/lib/enhances/resolveColorEnhance";
13
12
  import { Trend } from "./Trend.mjs";
13
+ import { Box } from "@semcore/flex-box";
14
+ import { extractAriaProps } from "@semcore/utils/lib/ariaProps";
14
15
  /*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
15
16
  var style = (
16
17
  /*__reshadow_css_start__*/
17
18
  (sstyled.insert(
18
19
  /*__inner_css_start__*/
19
- "@keyframes pulse_1yrsa{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1yrsa_gg_.__loading_1yrsa_gg_,.___SLineGauge_1yrsa_gg_.__loading_1yrsa_gg_,.___STrendBar_1yrsa_gg_.__loading_1yrsa_gg_,.___STrendLine_1yrsa_gg_.__loading_1yrsa_gg_{animation-name:pulse_1yrsa;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
20
+ "@keyframes pulse_mylya{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_mylya_gg_.__loading_mylya_gg_,.___SLineGauge_mylya_gg_.__loading_mylya_gg_,.___STrendBar_mylya_gg_.__loading_mylya_gg_,.___STrendLine_mylya_gg_.__loading_mylya_gg_{animation-name:pulse_mylya;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
20
21
  /*__inner_css_end__*/
21
- "1yrsa_gg_"
22
+ "mylya_gg_"
22
23
  ), /*__reshadow_css_end__*/
23
24
  {
24
- "__SLineGauge": "___SLineGauge_1yrsa_gg_",
25
- "_loading": "__loading_1yrsa_gg_",
26
- "__SDonutContainer": "___SDonutContainer_1yrsa_gg_",
27
- "__STrendLine": "___STrendLine_1yrsa_gg_",
28
- "__STrendBar": "___STrendBar_1yrsa_gg_",
29
- "@pulse": "pulse_1yrsa"
25
+ "__SLineGauge": "___SLineGauge_mylya_gg_",
26
+ "_loading": "__loading_mylya_gg_",
27
+ "__SDonutContainer": "___SDonutContainer_mylya_gg_",
28
+ "__STrendLine": "___STrendLine_mylya_gg_",
29
+ "__STrendBar": "___STrendBar_mylya_gg_",
30
+ "@pulse": "pulse_mylya"
30
31
  })
31
32
  );
32
- var TrendBarRoot = /* @__PURE__ */ (function(_Trend) {
33
+ var TrendBarRoot = /* @__PURE__ */ function(_Trend) {
34
+ _inherits(TrendBarRoot2, _Trend);
35
+ var _super = _createSuper(TrendBarRoot2);
33
36
  function TrendBarRoot2() {
34
37
  _classCallCheck(this, TrendBarRoot2);
35
- return _callSuper(this, TrendBarRoot2, arguments);
38
+ return _super.apply(this, arguments);
36
39
  }
37
- _inherits(TrendBarRoot2, _Trend);
38
- return _createClass(TrendBarRoot2, [{
40
+ _createClass(TrendBarRoot2, [{
39
41
  key: "defaultData",
40
42
  get: function get() {
41
43
  return [{
@@ -65,7 +67,7 @@ var TrendBarRoot = /* @__PURE__ */ (function(_Trend) {
65
67
  var _this$asProps2 = this.asProps, styles = _this$asProps2.styles, resolveColor = _this$asProps2.resolveColor, isHistogram = _this$asProps2.isHistogram, animate = _this$asProps2.animate, loading = _this$asProps2.loading;
66
68
  var step = this.defaultWidth / this.data.length;
67
69
  var _extractAriaProps = extractAriaProps(this.asProps), __excludeProps = _extractAriaProps.__excludeProps, extractedAriaProps = _extractAriaProps.extractedAriaProps;
68
- return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(STrendBar, _ref2.cn("STrendBar", _objectSpread({}, assignProps({
70
+ return _ref2 = sstyled$1(styles), /* @__PURE__ */ React.createElement(STrendBar, _ref2.cn("STrendBar", _objectSpread({}, assignProps({
69
71
  "ref": this.containerRef,
70
72
  "__excludeProps": ["data"].concat(_toConsumableArray(__excludeProps))
71
73
  }, _ref))), /* @__PURE__ */ React.createElement("svg", _ref2.cn("svg", _objectSpread({
@@ -93,7 +95,8 @@ var TrendBarRoot = /* @__PURE__ */ (function(_Trend) {
93
95
  })));
94
96
  }
95
97
  }]);
96
- })(Trend);
98
+ return TrendBarRoot2;
99
+ }(Trend);
97
100
  _defineProperty(TrendBarRoot, "enhance", [resolveColorEnhance()]);
98
101
  _defineProperty(TrendBarRoot, "style", style);
99
102
  _defineProperty(TrendBarRoot, "defaultProps", {
@@ -112,7 +115,7 @@ var TrendHistogram = createComponent(TrendBarRoot, {}, {
112
115
  };
113
116
  }]
114
117
  });
115
- TrendHistogram.displayName = "MiniChart.TrendHistogram";
118
+ TrendBar.displayName = "MiniChart.TrendHistogram";
116
119
  export {
117
120
  TrendBar,
118
121
  TrendHistogram
@@ -2,41 +2,43 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
3
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/esm/createClass";
5
- import _callSuper from "@babel/runtime/helpers/esm/callSuper";
6
5
  import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
7
7
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
8
- import { sstyled, assignProps, createComponent } from "@semcore/core";
9
- import { Box } from "@semcore/base-components";
10
- import { extractAriaProps } from "@semcore/core/lib/utils/ariaProps";
11
- import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
12
- import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
8
+ import { sstyled } from "@semcore/utils/lib/core/index";
9
+ import createComponent, { assignProps, sstyled as sstyled$1 } from "@semcore/core";
13
10
  import React from "react";
11
+ import resolveColorEnhance from "@semcore/utils/lib/enhances/resolveColorEnhance";
12
+ import uniqueIDEnhancement from "@semcore/utils/lib/uniqueID";
14
13
  import { Trend } from "./Trend.mjs";
14
+ import { Box } from "@semcore/flex-box";
15
+ import { extractAriaProps } from "@semcore/utils/lib/ariaProps";
15
16
  /*!__reshadow-styles__:"../skeleton/skeleton.shadow.css"*/
16
17
  var style = (
17
18
  /*__reshadow_css_start__*/
18
19
  (sstyled.insert(
19
20
  /*__inner_css_start__*/
20
- "@keyframes pulse_1yrsa{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_1yrsa_gg_.__loading_1yrsa_gg_,.___SLineGauge_1yrsa_gg_.__loading_1yrsa_gg_,.___STrendBar_1yrsa_gg_.__loading_1yrsa_gg_,.___STrendLine_1yrsa_gg_.__loading_1yrsa_gg_{animation-name:pulse_1yrsa;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
21
+ "@keyframes pulse_mylya{0%,to{opacity:1}50%{opacity:.4}}.___SDonutContainer_mylya_gg_.__loading_mylya_gg_,.___SLineGauge_mylya_gg_.__loading_mylya_gg_,.___STrendBar_mylya_gg_.__loading_mylya_gg_,.___STrendLine_mylya_gg_.__loading_mylya_gg_{animation-name:pulse_mylya;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.6s;will-change:opacity}",
21
22
  /*__inner_css_end__*/
22
- "1yrsa_gg_"
23
+ "mylya_gg_"
23
24
  ), /*__reshadow_css_end__*/
24
25
  {
25
- "__SLineGauge": "___SLineGauge_1yrsa_gg_",
26
- "_loading": "__loading_1yrsa_gg_",
27
- "__SDonutContainer": "___SDonutContainer_1yrsa_gg_",
28
- "__STrendLine": "___STrendLine_1yrsa_gg_",
29
- "__STrendBar": "___STrendBar_1yrsa_gg_",
30
- "@pulse": "pulse_1yrsa"
26
+ "__SLineGauge": "___SLineGauge_mylya_gg_",
27
+ "_loading": "__loading_mylya_gg_",
28
+ "__SDonutContainer": "___SDonutContainer_mylya_gg_",
29
+ "__STrendLine": "___STrendLine_mylya_gg_",
30
+ "__STrendBar": "___STrendBar_mylya_gg_",
31
+ "@pulse": "pulse_mylya"
31
32
  })
32
33
  );
33
- var TrendLineRoot = /* @__PURE__ */ (function(_Trend) {
34
+ var TrendLineRoot = /* @__PURE__ */ function(_Trend) {
35
+ _inherits(TrendLineRoot2, _Trend);
36
+ var _super = _createSuper(TrendLineRoot2);
34
37
  function TrendLineRoot2() {
35
38
  _classCallCheck(this, TrendLineRoot2);
36
- return _callSuper(this, TrendLineRoot2, arguments);
39
+ return _super.apply(this, arguments);
37
40
  }
38
- _inherits(TrendLineRoot2, _Trend);
39
- return _createClass(TrendLineRoot2, [{
41
+ _createClass(TrendLineRoot2, [{
40
42
  key: "defaultData",
41
43
  get: function get() {
42
44
  return [15, 70, 20, 85, 20];
@@ -88,7 +90,7 @@ var TrendLineRoot = /* @__PURE__ */ (function(_Trend) {
88
90
  points.push("".concat(step * i, ",").concat(this.defaultHeight - this.data[i]));
89
91
  }
90
92
  var _extractAriaProps = extractAriaProps(this.asProps), __excludeProps = _extractAriaProps.__excludeProps, extractedAriaProps = _extractAriaProps.extractedAriaProps;
91
- return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(STrendLine, _ref2.cn("STrendLine", _objectSpread({}, assignProps({
93
+ return _ref2 = sstyled$1(styles), /* @__PURE__ */ React.createElement(STrendLine, _ref2.cn("STrendLine", _objectSpread({}, assignProps({
92
94
  "ref": this.containerRef,
93
95
  "__excludeProps": ["data"].concat(_toConsumableArray(__excludeProps))
94
96
  }, _ref))), /* @__PURE__ */ React.createElement("svg", _ref2.cn("svg", _objectSpread({
@@ -130,7 +132,8 @@ var TrendLineRoot = /* @__PURE__ */ (function(_Trend) {
130
132
  }))))));
131
133
  }
132
134
  }]);
133
- })(Trend);
135
+ return TrendLineRoot2;
136
+ }(Trend);
134
137
  _defineProperty(TrendLineRoot, "enhance", [resolveColorEnhance(), uniqueIDEnhancement()]);
135
138
  _defineProperty(TrendLineRoot, "style", style);
136
139
  _defineProperty(TrendLineRoot, "defaultProps", {
@@ -1,27 +1,29 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _callSuper from "@babel/runtime/helpers/esm/callSuper";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
4
4
  import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
6
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
- import { Component } from "@semcore/core";
7
7
  import React from "react";
8
- var Trend = /* @__PURE__ */ (function(_Component) {
8
+ import { Component } from "@semcore/core";
9
+ var Trend = /* @__PURE__ */ function(_Component) {
10
+ _inherits(Trend2, _Component);
11
+ var _super = _createSuper(Trend2);
9
12
  function Trend2() {
10
13
  var _this;
11
14
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
12
15
  args[_key] = arguments[_key];
13
16
  }
14
17
  _classCallCheck(this, Trend2);
15
- _this = _callSuper(this, Trend2, [].concat(args));
16
- _defineProperty(_this, "state", {
18
+ _this = _super.call.apply(_super, [this].concat(args));
19
+ _defineProperty(_assertThisInitialized(_this), "state", {
17
20
  width: 200,
18
21
  height: 100
19
22
  });
20
- _defineProperty(_this, "containerRef", /* @__PURE__ */ React.createRef());
23
+ _defineProperty(_assertThisInitialized(_this), "containerRef", /* @__PURE__ */ React.createRef());
21
24
  return _this;
22
25
  }
23
- _inherits(Trend2, _Component);
24
- return _createClass(Trend2, [{
26
+ _createClass(Trend2, [{
25
27
  key: "componentDidMount",
26
28
  value: function componentDidMount() {
27
29
  this.setSizes();
@@ -69,7 +71,8 @@ var Trend = /* @__PURE__ */ (function(_Component) {
69
71
  }
70
72
  }
71
73
  }]);
72
- })(Component);
74
+ return Trend2;
75
+ }(Component);
73
76
  export {
74
77
  Trend
75
78
  };
package/lib/esm/index.mjs CHANGED
@@ -1,9 +1,7 @@
1
- import "./component/score/index.mjs";
2
- import "./component/trend/index.mjs";
1
+ import { ScoreSemiDonut, ScoreDonut } from "./component/score/Donut.mjs";
3
2
  import { ScoreLine } from "./component/score/Line.mjs";
4
- import { ScoreDonut, ScoreSemiDonut } from "./component/score/Donut.mjs";
5
- import { TrendHistogram, TrendBar } from "./component/trend/Bar.mjs";
6
- import { TrendArea, TrendLine } from "./component/trend/Line.mjs";
3
+ import { TrendLine, TrendArea } from "./component/trend/Line.mjs";
4
+ import { TrendBar, TrendHistogram } from "./component/trend/Bar.mjs";
7
5
  var miniCharts = {
8
6
  TrendLine,
9
7
  TrendArea,
@@ -1,9 +1,12 @@
1
- import { type BoxProps } from '@semcore/base-components';
2
- import type { CommonScoreProps } from './Score';
1
+ import { ComponentType } from '@semcore/core';
2
+ import { BoxProps } from '@semcore/flex-box';
3
+ import resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';
4
+ import { CommonScoreProps } from './Score';
3
5
  export type ScoreDonutProps = BoxProps & CommonScoreProps;
4
- export declare const ScoreDonut: import("@semcore/core").Intergalactic.Component<"svg", ScoreDonutProps, {}, readonly [<T extends {}>(props: T) => T & {
5
- duration: string;
6
- }, (props: any) => any]>;
7
- export declare const ScoreSemiDonut: import("@semcore/core").Intergalactic.Component<"svg", ScoreDonutProps, {}, readonly [<T extends {}>(props: T) => T & {
8
- duration: string;
9
- }, (props: any) => any]>;
6
+ type Enhances = {
7
+ resolveColor: ReturnType<typeof resolveColorEnhance>;
8
+ isSemiDonut?: true;
9
+ };
10
+ export declare const ScoreDonut: ComponentType<ScoreDonutProps, {}, {}, Enhances>;
11
+ export declare const ScoreSemiDonut: ComponentType<ScoreDonutProps, {}, {}, Enhances>;
12
+ export {};
@@ -1,2 +1,2 @@
1
- import type { ScoreLineComponent } from './Line.types';
1
+ import { ScoreLineComponent } from './Line.types';
2
2
  export declare const ScoreLine: ScoreLineComponent;
@@ -1,8 +1,8 @@
1
- import type { BoxProps, Box } from '@semcore/base-components';
2
- import type { Intergalactic } from '@semcore/core';
3
- import type resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
4
- import type React from 'react';
5
- import type { CommonScoreProps } from './Score';
1
+ import { Intergalactic, ComponentType } from '@semcore/utils/lib/core';
2
+ import { CommonScoreProps } from './Score';
3
+ import React from 'react';
4
+ import { BoxProps, Box } from '@semcore/flex-box';
5
+ import resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';
6
6
  type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>;
7
7
  type Range<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
8
8
  export type SegmentColor = `chart-palette-order-${Range<1, 24>}`;
@@ -39,12 +39,10 @@ type CustomRenderScoreProps = {
39
39
  children: SegmentComponent[];
40
40
  };
41
41
  export type ScoreLineGaugeProps = BoxProps & Intergalactic.InternalTypings.EfficientOmit<CommonScoreProps, 'value' | 'color'> & (ValuedScoreProps | CustomRenderScoreProps);
42
- export type Enhances = [
43
- () => {
44
- resolveColor: ReturnType<typeof resolveColorEnhance>;
45
- }
46
- ];
47
- export type ScoreLineComponent = Intergalactic.Component<'svg', ScoreLineGaugeProps, {}, Enhances> & {
42
+ export type Enhances = {
43
+ resolveColor: ReturnType<typeof resolveColorEnhance>;
44
+ };
45
+ export type ScoreLineComponent = ComponentType<ScoreLineGaugeProps, {}, {}, Enhances> & {
48
46
  Segment: Intergalactic.Component<typeof Box, SegmentProps>;
49
47
  };
50
48
  export {};