@m4l/widgets 0.0.3-beta-add-widget-serieschart.0 → 0.0.3

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.
@@ -5,6 +5,6 @@ import { SeriesChartProps } from './types';
5
5
  * @param _size - Component size (reserved for future use)
6
6
  * @returns SeriesChart component
7
7
  */
8
- export declare function SeriesChart({ values, size: _size }: SeriesChartProps): import("@emotion/react/jsx-runtime").JSX.Element;
8
+ export declare function SeriesChart({ values, scrollable }: SeriesChartProps): import("@emotion/react/jsx-runtime").JSX.Element;
9
9
  export default SeriesChart;
10
10
  //# sourceMappingURL=SeriesChart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SeriesChart.d.ts","sourceRoot":"","sources":["../../../../../../packages/widgets/src/charts/SeriesChart/SeriesChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAShD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,gBAAgB,oDAsBpE;AAED,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"SeriesChart.d.ts","sourceRoot":"","sources":["../../../../../../packages/widgets/src/charts/SeriesChart/SeriesChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAShD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,UAAkB,EAAE,EAAE,gBAAgB,oDAsB3E;AAED,eAAe,WAAW,CAAC"}
@@ -1,17 +1,17 @@
1
1
  import { jsx as e } from "@emotion/react/jsx-runtime";
2
2
  import s from "echarts-for-react";
3
- import { useRef as m, useMemo as a } from "react";
4
- import { SeriesChartRootStyled as f, ChartContainerStyled as h } from "./slots/SeriesChartSlots.js";
5
- import { useChartResize as p } from "./hooks/useChartResize.js";
3
+ import { useRef as f, useMemo as a } from "react";
4
+ import { SeriesChartRootStyled as h, ChartContainerStyled as p } from "./slots/SeriesChartSlots.js";
5
+ import { useChartResize as u } from "./hooks/useChartResize.js";
6
6
  import { useTheme as c } from "@mui/material";
7
- import { generateOptions as l } from "./helpers/options.js";
8
- function x({ values: t, size: u }) {
9
- const r = m(null), o = c(), i = a(() => l(t, o), [t, o]), n = p(r);
10
- return /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(h, { ref: n, children: /* @__PURE__ */ e(
7
+ import { generateOptions as d } from "./helpers/options.js";
8
+ function z({ values: t, scrollable: r = !1 }) {
9
+ const o = f(null), i = c(), n = a(() => d(t, i, r), [t, i, r]), m = u(o);
10
+ return /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(p, { ref: m, children: /* @__PURE__ */ e(
11
11
  s,
12
12
  {
13
- ref: r,
14
- option: i,
13
+ ref: o,
14
+ option: n,
15
15
  style: { height: "100%", width: "100%" },
16
16
  notMerge: !0,
17
17
  lazyUpdate: !0
@@ -19,6 +19,6 @@ function x({ values: t, size: u }) {
19
19
  ) }) });
20
20
  }
21
21
  export {
22
- x as SeriesChart,
23
- x as default
22
+ z as SeriesChart,
23
+ z as default
24
24
  };
@@ -3,5 +3,5 @@ import { SeriesChartProps } from '../types';
3
3
  /**
4
4
  * Builds ECharts option config for the series chart from data and theme.
5
5
  */
6
- export declare function generateOptions(values: SeriesChartProps['values'], theme: Theme): any;
6
+ export declare function generateOptions(values: SeriesChartProps['values'], theme: Theme, scrollable: boolean): any;
7
7
  //# sourceMappingURL=options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/widgets/src/charts/SeriesChart/helpers/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAK5C;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,GAAG,CA8OrF"}
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/widgets/src/charts/SeriesChart/helpers/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAK5C;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,GAAG,GAAG,CA4O1G"}
@@ -1,8 +1,15 @@
1
- import { getColorHexFromVar as c, getColorHexFromToken as l } from "../../../tools/color.js";
2
- import * as b from "echarts";
3
- import { remapTooltipFormatter as h } from "./tooltipFormatter.js";
4
- function C(o, a) {
5
- const i = c(a.vars?.palette?.text?.primary ?? "#323b3b"), e = c(a.vars?.palette?.text?.disabled ?? "#aaadb1"), s = c(a.vars?.palette?.background?.default ?? "#FFFFFF"), p = c(a.vars?.palette?.text?.contrastText ?? "#FFFFFF"), f = c(a.vars?.palette?.background?.neutral ?? "#F1F5F9"), y = m(o.values[0]);
1
+ import { getColorHexFromVar as i, getColorHexFromToken as n } from "../../../tools/color.js";
2
+ import * as f from "echarts";
3
+ import { remapTooltipFormatter as y } from "./tooltipFormatter.js";
4
+ function m(o, r, d) {
5
+ const e = {
6
+ textPrimaryColor: i(r.vars?.palette?.text?.primary),
7
+ textDisabledColor: i(r.vars?.palette?.text?.disabled),
8
+ themeBackgroundColor: i(r.vars?.palette?.background?.default),
9
+ contrastTextColor: i(r.vars?.palette?.text?.contrastText),
10
+ backgroundNeutralColor: i(r.vars?.palette?.background?.neutral),
11
+ contrastDefaultColor: i(r.vars?.palette?.background?.contrastDefault)
12
+ }, c = g(o.values[0]);
6
13
  return {
7
14
  baseOption: {
8
15
  /**
@@ -15,25 +22,25 @@ function C(o, a) {
15
22
  shadowColor: "transparent",
16
23
  borderWidth: 0,
17
24
  textStyle: {
18
- color: p,
25
+ color: e.contrastTextColor,
19
26
  fontFamily: "Inter",
20
27
  fontSize: 13,
21
28
  fontWeight: 700
22
29
  },
23
- formatter: (t) => h(t, o),
30
+ formatter: (t) => y(t, o, e),
24
31
  axisPointer: {
25
32
  type: "cross",
26
33
  lineStyle: {
27
- color: e,
34
+ color: e.textDisabledColor,
28
35
  type: "solid"
29
36
  },
30
37
  crossStyle: {
31
- color: e,
38
+ color: e.textDisabledColor,
32
39
  type: "solid"
33
40
  },
34
41
  label: {
35
- backgroundColor: f,
36
- color: i,
42
+ backgroundColor: e.backgroundNeutralColor,
43
+ color: e.textPrimaryColor,
37
44
  fontFamily: "Inter",
38
45
  fontSize: 13,
39
46
  fontWeight: 400,
@@ -44,21 +51,16 @@ function C(o, a) {
44
51
  /**
45
52
  * Data zoom configuration.
46
53
  */
47
- dataZoom: [
48
- // {
49
- // type: 'slider',
50
- // show: true,
51
- // realtime: true,
52
- // start: 0,
53
- // end: Math.max(1, Math.round(100 * 3 / values.values.length)),
54
- // height: 15,
55
- // bottom: 5,
56
- // xAxisIndex: [0, 1],
57
- // borderColor: 'transparent',
58
- // // backgroundColor: themeContrastColor,
59
- // // fillerColor: 'rgba(39, 176, 37, 0.2)',
60
- // showDetail: false,
61
- // },
54
+ dataZoom: d ? [
55
+ {
56
+ type: "slider",
57
+ show: !0,
58
+ realtime: !0,
59
+ start: 0,
60
+ end: Math.max(1, Math.round(300 / o.values.length)),
61
+ height: 15,
62
+ bottom: 5
63
+ },
62
64
  {
63
65
  type: "inside",
64
66
  realtime: !0,
@@ -66,7 +68,7 @@ function C(o, a) {
66
68
  end: 70,
67
69
  xAxisIndex: [0, 1]
68
70
  }
69
- ],
71
+ ] : [{ show: !1 }],
70
72
  /**
71
73
  * Legend configuration.
72
74
  */
@@ -81,17 +83,17 @@ function C(o, a) {
81
83
  itemHeight: 11,
82
84
  textStyle: {
83
85
  fontSize: 12,
84
- color: i
86
+ color: e.textPrimaryColor
85
87
  },
86
88
  data: o.series.map((t) => t.title)
87
89
  },
88
90
  /**
89
91
  * X-axis configuration.
90
92
  */
91
- xAxis: o.xAxis.map((t, r) => ({
93
+ xAxis: o.xAxis.map((t, a) => ({
92
94
  type: "category",
93
- data: o.values.map((n) => n[t.field]),
94
- offset: r > 1 ? (r - 1) * 20 : 0,
95
+ data: o.values.map((l) => l[t.field]),
96
+ offset: a > 1 ? (a - 1) * 20 : 0,
95
97
  axisLine: { show: !1 },
96
98
  axisTick: { show: !1 },
97
99
  axisLabel: {
@@ -101,32 +103,32 @@ function C(o, a) {
101
103
  fontSize: 11,
102
104
  fontWeight: 500,
103
105
  hideOverlap: !0,
104
- color: i
106
+ color: e.textPrimaryColor
105
107
  }
106
108
  })),
107
109
  /**
108
110
  * Y-axis configuration.
109
111
  */
110
- yAxis: o.yAxis.map((t, r) => {
111
- const n = o.series.find((d) => d.yAxisId === t.id), x = y[n?.field || ""] || "", g = l(n?.pallet_color || "", "contained", "backgroundColorTone");
112
+ yAxis: o.yAxis.map((t, a) => {
113
+ const l = o.series.find((s) => s.yAxisId === t.id), p = c[l?.field || ""] || "", x = n(l?.pallet_color || "", "contained", "backgroundColorTone");
112
114
  return {
113
115
  type: "value",
114
- name: t.title + " (" + x + ")",
115
- position: r === 0 ? "left" : "right",
116
- offset: r > 1 ? (r - 1) * 70 : 0,
116
+ name: t.title + " (" + p + ")",
117
+ position: a === 0 ? "left" : "right",
118
+ offset: a > 1 ? (a - 1) * 70 : 0,
117
119
  alignTicks: !0,
118
120
  splitLine: {
119
121
  show: !0,
120
122
  lineStyle: {
121
123
  type: "dashed",
122
- color: e,
124
+ color: e.textDisabledColor,
123
125
  opacity: 0.3,
124
126
  width: 1,
125
127
  dashOffset: 0
126
128
  }
127
129
  },
128
130
  nameTextStyle: {
129
- color: e,
131
+ color: e.textDisabledColor,
130
132
  fontFamily: "Inter",
131
133
  fontSize: "12px",
132
134
  fontWeight: 500
@@ -134,18 +136,18 @@ function C(o, a) {
134
136
  nameRotate: 90,
135
137
  nameLocation: "middle",
136
138
  axisLabel: {
137
- color: i,
139
+ color: e.textPrimaryColor,
138
140
  fontFamily: "Jura",
139
141
  fontSize: "13px",
140
142
  fontWeight: 700,
141
143
  overflow: "break",
142
144
  ellipsis: "...",
143
145
  width: 30,
144
- formatter: (d) => `${d}`
146
+ formatter: (s) => `${s}`
145
147
  },
146
148
  axisLine: {
147
149
  show: !0,
148
- lineStyle: { color: g, width: 0.5, opacity: 1 }
150
+ lineStyle: { color: x, width: 0.5, opacity: 1 }
149
151
  }
150
152
  };
151
153
  }),
@@ -163,16 +165,16 @@ function C(o, a) {
163
165
  * Series configuration.
164
166
  */
165
167
  series: o.series.map((t) => {
166
- const r = o.yAxis.findIndex((n) => n.id === t.yAxisId);
168
+ const a = o.yAxis.findIndex((l) => l.id === t.yAxisId);
167
169
  return {
168
170
  name: t.title,
169
171
  type: t.type,
170
- yAxisIndex: r !== -1 ? r : 0,
172
+ yAxisIndex: a !== -1 ? a : 0,
171
173
  areaStyle: {
172
- color: new b.graphic.LinearGradient(0, 0, 0, 1, [
174
+ color: new f.graphic.LinearGradient(0, 0, 0, 1, [
173
175
  {
174
176
  offset: 0,
175
- color: l(t?.pallet_color || "", "contained", "backgroundColor")
177
+ color: n(t?.pallet_color || "", "contained", "backgroundColor")
176
178
  },
177
179
  {
178
180
  offset: 0.8,
@@ -180,22 +182,22 @@ function C(o, a) {
180
182
  }
181
183
  ])
182
184
  },
183
- data: o.values.map((n) => n[t.field].r),
185
+ data: o.values.map((l) => l[t.field].r),
184
186
  ...t.type === "line" && {
185
187
  symbol: "circle",
186
188
  symbolSize: 10,
187
189
  itemStyle: {
188
190
  borderWidth: 2,
189
- borderColor: l(t.pallet_color, "contained", "backgroundColorTone"),
190
- color: s
191
+ borderColor: n(t.pallet_color, "contained", "backgroundColorTone"),
192
+ color: e.themeBackgroundColor
191
193
  },
192
194
  lineStyle: {
193
195
  width: 2,
194
- color: l(t.pallet_color, "contained", "backgroundColorTone")
196
+ color: n(t.pallet_color, "contained", "backgroundColorTone")
195
197
  },
196
198
  emphasis: {
197
199
  itemStyle: {
198
- color: l(t.pallet_color, "contained", "backgroundColorTone")
200
+ color: n(t.pallet_color, "contained", "backgroundColorTone")
199
201
  }
200
202
  }
201
203
  },
@@ -206,7 +208,7 @@ function C(o, a) {
206
208
  itemStyle: {
207
209
  borderRadius: [6, 6, 0, 0]
208
210
  },
209
- color: l(t.pallet_color, "contained", "backgroundColorTone")
211
+ color: n(t.pallet_color, "contained", "backgroundColorTone")
210
212
  }
211
213
  };
212
214
  })
@@ -216,12 +218,12 @@ function C(o, a) {
216
218
  }
217
219
  };
218
220
  }
219
- function m(o) {
220
- return Object.keys(o).reduce((a, i) => {
221
- const e = o[i];
222
- return e && typeof e == "object" && "v" in e && (a[i] = e.v.replace(/[0-9.\s]+/g, "")), a;
221
+ function g(o) {
222
+ return Object.keys(o).reduce((r, d) => {
223
+ const e = o[d];
224
+ return e && typeof e == "object" && "v" in e && (r[d] = e.v.replace(/[0-9.\s]+/g, "")), r;
223
225
  }, {});
224
226
  }
225
227
  export {
226
- C as generateOptions
228
+ m as generateOptions
227
229
  };
@@ -2,5 +2,5 @@ import { SeriesChartProps } from '../types';
2
2
  /**
3
3
  * Formats ECharts tooltip params to HTML for SeriesChart.
4
4
  */
5
- export declare function remapTooltipFormatter(params: any[], values: SeriesChartProps['values']): string;
5
+ export declare function remapTooltipFormatter(params: any[], values: SeriesChartProps['values'], themeColors: any): string;
6
6
  //# sourceMappingURL=tooltipFormatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltipFormatter.d.ts","sourceRoot":"","sources":["../../../../../../../packages/widgets/src/charts/SeriesChart/helpers/tooltipFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,UA+FtF"}
1
+ {"version":3,"file":"tooltipFormatter.d.ts","sourceRoot":"","sources":["../../../../../../../packages/widgets/src/charts/SeriesChart/helpers/tooltipFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,GAAG,UA+FxG"}
@@ -1,5 +1,5 @@
1
- function c(r, a) {
2
- let t = `
1
+ function d(a, s, t) {
2
+ let r = `
3
3
  <div style="
4
4
  display: flex;
5
5
  padding: var(--theme-vars-size-baseSpacings-sp3, 12px);
@@ -7,12 +7,12 @@ function c(r, a) {
7
7
  justify-content: center;
8
8
  align-items: center;
9
9
  border-radius: var(--size-borderRadius-r3, 12px);
10
- background: color-mix(in srgb, var(--theme-vars-palette-background-contrastDefault, #323B3B) 90%, transparent);
10
+ background: color-mix(in srgb, ${t.contrastDefaultColor} 90%, transparent);
11
11
  box-shadow: 0 4px 8px -5px var(--customShadowsColors-sh3, rgba(95, 108, 125, 0.16)), 0 8px 30px -1px var(--customShadowsColors-sh2, rgba(109, 124, 146, 0.12));
12
12
  gap: var(--theme-vars-size-baseSpacings-sp2, 8px);
13
13
  ">
14
14
  <h3 style="
15
- color: var(--theme-vars-palette-text-contrastText, #FFF);
15
+ color: ${t.contrastTextColor};
16
16
  font-family: var(--typographyInter-font-family, Inter);
17
17
  font-size: var(--typoghaphy-size-Inter-paragraph, 13px);
18
18
  font-style: normal;
@@ -21,7 +21,7 @@ function c(r, a) {
21
21
  letter-spacing: var(--typographyInter-letter-spacing-dens, 0.8px);
22
22
  align-self: stretch;
23
23
  ">
24
- ${r[0].name}
24
+ ${a[0].name}
25
25
  </h3>
26
26
  <div style="
27
27
  display: flex;
@@ -32,29 +32,29 @@ function c(r, a) {
32
32
  align-self: stretch;
33
33
  ">
34
34
  `;
35
- return r.forEach((e) => {
36
- const n = a.values[e.dataIndex][a.series[e.seriesIndex].field].v, o = e.color, s = e.borderColor, i = `
35
+ return a.forEach((e) => {
36
+ const o = s.values[e.dataIndex][s.series[e.seriesIndex].field].v, i = e.color, n = e.borderColor, l = `
37
37
  <div style="
38
38
  width: 11px;
39
39
  height: 0;
40
40
  stroke-width: 3px;
41
- stroke: ${s};
41
+ stroke: ${n};
42
42
  display: flex;
43
43
  justify-content: center;
44
44
  align-items: center;
45
45
  ">
46
46
  <svg width="14" height="3" viewBox="0 0 14 3" fill="none" xmlns="http://www.w3.org/2000/svg">
47
- <path d="M1.5 1.5H12.5" stroke="${s}" stroke-width="3" stroke-linecap="round"/>
47
+ <path d="M1.5 1.5H12.5" stroke="${n}" stroke-width="3" stroke-linecap="round"/>
48
48
  </svg>
49
- </div>`, l = `
49
+ </div>`, p = `
50
50
  <span style="
51
51
  width: 11px;
52
52
  height: 11px;
53
53
  border-radius: 5px;
54
- background: ${o};
54
+ background: ${i};
55
55
  ">
56
- </span>`, p = e.seriesType === "line" ? i : l;
57
- t += `
56
+ </span>`, c = e.seriesType === "line" ? l : p;
57
+ r += `
58
58
  <div style="
59
59
  display: flex;
60
60
  height: var(--theme-vars-size-device-size-action, 24px);
@@ -63,23 +63,23 @@ function c(r, a) {
63
63
  gap: 8px;
64
64
  border-radius: 6px;
65
65
  ">
66
- ${p}
66
+ ${c}
67
67
  <span style="
68
- color: var(--theme-vars-palette-text-contrastText, #FFF);
68
+ color: ${t.contrastTextColor};
69
69
  font-family: var(--typographyInter-font-family, Inter);
70
70
  font-size: var(--typoghaphy-size-Inter-body, 11px);
71
71
  font-style: normal;
72
72
  font-weight: 500;
73
73
  line-height: normal;
74
74
  letter-spacing: var(--typographyInter-letter-spacing-normal, 0.5px);
75
- "><b>${n}</b></span>
75
+ "><b>${o}</b></span>
76
76
  </div>
77
77
  `;
78
- }), t += `
78
+ }), r += `
79
79
  </div>
80
80
  </div>
81
- `, t;
81
+ `, r;
82
82
  }
83
83
  export {
84
- c as remapTooltipFormatter
84
+ d as remapTooltipFormatter
85
85
  };
@@ -1,4 +1,3 @@
1
- import { Sizes } from '@m4l/styles';
2
1
  import { SeriesChartSlots } from './slots/SeriesChartEnum';
3
2
  import { SERIES_KEY_COMPONENT } from './constants';
4
3
  import { M4LOverridesStyleRules } from '@m4l/components';
@@ -47,11 +46,10 @@ export interface SeriesChartValueItem {
47
46
  export interface SeriesChartProps {
48
47
  /** Chart values (name, formatted value, numeric value, color). */
49
48
  values: SeriesChartValueItem;
50
- /** Component size. */
51
- size?: Extract<Sizes, 'small' | 'medium'>;
49
+ /** Chart scrollable option. */
50
+ scrollable?: boolean;
52
51
  }
53
52
  export type SeriesChartOwnerState = {
54
- size?: SeriesChartProps['size'];
55
53
  color?: string;
56
54
  };
57
55
  export type SeriesChartSlotsType = keyof typeof SeriesChartSlots;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/widgets/src/charts/SeriesChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C;;GAEG;AAEH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ;;OAEG;IACH,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ;;OAEG;IACH,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;IACJ;;OAEG;IACH,MAAM,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG;YACb,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,MAAM,CAAC;SACX,GAAG,MAAM,CAAC;KACZ,EAAE,CAAC;CACL;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,MAAM,EAAE,oBAAoB,CAAC;IAC7B,sBAAsB;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;CAC3C;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,gBAAgB,CAAC;AACjE,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,oBAAoB,EAAE,OAAO,oBAAoB,EAAE,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/widgets/src/charts/SeriesChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C;;GAEG;AAEH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ;;OAEG;IACH,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ;;OAEG;IACH,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;IACJ;;OAEG;IACH,MAAM,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG;YACb,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,MAAM,CAAC;SACX,GAAG,MAAM,CAAC;KACZ,EAAE,CAAC;CACL;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,MAAM,EAAE,oBAAoB,CAAC;IAC7B,+BAA+B;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,gBAAgB,CAAC;AACjE,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,oBAAoB,EAAE,OAAO,oBAAoB,EAAE,KAAK,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/widgets",
3
- "version": "0.0.3-beta-add-widget-serieschart.0",
3
+ "version": "0.0.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/tools/color.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { ChipColor } from '@m4l/styles';
2
2
  /**
3
3
  * Resolves a CSS variable or hexadecimal color string to a hexadecimal color value.
4
+ * Returns a fallback when color is undefined (e.g. theme vars missing in tests).
4
5
  */
5
- export declare function getColorHexFromVar(color: string): string;
6
+ export declare function getColorHexFromVar(color: string | undefined): string;
6
7
  /**
7
8
  * Resolves a color token or hex string to a usable color value.
8
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../../packages/widgets/src/tools/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,UAO/C;AAID;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,WAAW,GAAG,UAAwB,EACjD,QAAQ,GAAE,MAAM,SAAiC,UAUlD"}
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../../packages/widgets/src/tools/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAYpE;AAID;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,WAAW,GAAG,UAAwB,EACjD,QAAQ,GAAE,MAAM,SAAiC,UAUlD"}
package/tools/color.js CHANGED
@@ -1,17 +1,17 @@
1
- import { BASE_TAG_OBJECT_COLORS_LIGHT as o } from "@m4l/styles";
2
- function m(e) {
3
- return e.includes("#") ? e : (e = e.replace("var(", ""), e = e.replace(")", ""), getComputedStyle(document.documentElement).getPropertyValue(e).trim());
1
+ import { BASE_TAG_OBJECT_COLORS_LIGHT as i } from "@m4l/styles";
2
+ function o(e) {
3
+ return e === null || typeof e != "string" ? r : e.includes("#") ? e : (e = e.replace("var(", ""), e = e.replace(")", ""), getComputedStyle(document.documentElement).getPropertyValue(e).trim() || r);
4
4
  }
5
- const t = "#9ca3af";
5
+ const r = "#9ca3af";
6
6
  function a(e, n = "contained", u = "backgroundColorTone") {
7
7
  if (e.includes("#"))
8
8
  return e;
9
9
  if (!e?.trim())
10
- return t;
11
- const r = o[e];
12
- return r ? r[n][u] : t;
10
+ return r;
11
+ const t = i[e];
12
+ return t ? t[n][u] : r;
13
13
  }
14
14
  export {
15
15
  a as getColorHexFromToken,
16
- m as getColorHexFromVar
16
+ o as getColorHexFromVar
17
17
  };