@gostudent/shared-ui-library 1.33.0 → 2.0.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/dist/LineChartImpl-ocsbcloT.js +145 -0
- package/dist/{index-BetfWNU1.js → index-DYPksIJ5.js} +1679 -1661
- package/dist/index.js +41 -40
- package/dist/src/components/LineChart/LineChart.d.ts +1 -1
- package/dist/src/components/LineChart/LineChart.d.ts.map +1 -1
- package/dist/src/components/LineChart/LineChartImpl.d.ts +6 -2
- package/dist/src/components/LineChart/LineChartImpl.d.ts.map +1 -1
- package/dist/src/components/Tag/Tag.d.ts +4 -2
- package/dist/src/components/Tag/Tag.d.ts.map +1 -1
- package/dist/src/compositions/GradeHistoryChart/GradeHistoryChart.d.ts +6 -0
- package/dist/src/compositions/GradeHistoryChart/GradeHistoryChart.d.ts.map +1 -1
- package/dist/src/icons/PaperIcon.d.ts +8 -0
- package/dist/src/icons/PaperIcon.d.ts.map +1 -0
- package/dist/src/icons/index.d.ts +2 -0
- package/dist/src/icons/index.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/tokens/output/gs/semantic-colors/tokens.d.ts +3 -2
- package/dist/src/tokens/output/gs/semantic-colors/tokens.d.ts.map +1 -1
- package/dist/src/tokens/output/sk/semantic-colors/tokens.d.ts +3 -2
- package/dist/src/tokens/output/sk/semantic-colors/tokens.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/themes/theme-gs.css +6 -5
- package/dist/themes/theme-sk.css +17 -16
- package/package.json +1 -1
- package/src/tokens/output/gs/semantic-colors/tokens.d.ts +3 -2
- package/src/tokens/output/gs/semantic-colors/tokens.js +3 -2
- package/src/tokens/output/gs/semantic-colors/tokens.ts +3 -2
- package/src/tokens/output/gs/semantic-colors/variables.css +6 -5
- package/src/tokens/output/sk/semantic-colors/tokens.d.ts +3 -2
- package/src/tokens/output/sk/semantic-colors/tokens.js +3 -2
- package/src/tokens/output/sk/semantic-colors/tokens.ts +3 -2
- package/src/tokens/output/sk/semantic-colors/variables.css +10 -9
- package/src/tokens/output/sk/semantic-font-desktop/variables.css +2 -2
- package/src/tokens/output/sk/semantic-font-mobile/variables.css +5 -5
- package/dist/LineChartImpl-DUgs8fvF.js +0 -155
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { ResponsiveContainer as W, LineChart as S, CartesianGrid as C, XAxis as A, YAxis as I, Tooltip as B, Line as E, ReferenceLine as R } from "recharts";
|
|
3
|
+
import { s as t, f as x, e as T } from "./index-DYPksIJ5.js";
|
|
4
|
+
const m = 28, g = [
|
|
5
|
+
"var(--color-chart-series-1)",
|
|
6
|
+
"var(--color-chart-series-2)",
|
|
7
|
+
"var(--color-chart-series-3)",
|
|
8
|
+
"var(--color-chart-series-4)",
|
|
9
|
+
"var(--color-chart-series-5)",
|
|
10
|
+
"var(--color-chart-series-6)",
|
|
11
|
+
"var(--color-chart-series-7)",
|
|
12
|
+
"var(--color-chart-series-8)"
|
|
13
|
+
];
|
|
14
|
+
function p(l) {
|
|
15
|
+
let r = 0;
|
|
16
|
+
for (let s = 0; s < l.length; s++)
|
|
17
|
+
r = l.charCodeAt(s) + ((r << 5) - r);
|
|
18
|
+
return g[Math.abs(r) % g.length];
|
|
19
|
+
}
|
|
20
|
+
function j({ active: l, payload: r, label: s, locale: d }) {
|
|
21
|
+
if (!l || !(r != null && r.length)) return null;
|
|
22
|
+
const h = s != null ? new Date(s) : null, i = h ? x(h, "d MMM yyyy", { locale: d }) : "";
|
|
23
|
+
return /* @__PURE__ */ c("div", { className: t.tooltip, role: "tooltip", children: [
|
|
24
|
+
i && /* @__PURE__ */ e("p", { className: t.tooltipDate, children: i }),
|
|
25
|
+
r.map((o) => /* @__PURE__ */ c("div", { className: t.tooltipRow, children: [
|
|
26
|
+
/* @__PURE__ */ e("span", { className: t.tooltipDot, style: { background: o.color }, "aria-hidden": "true" }),
|
|
27
|
+
/* @__PURE__ */ e("span", { className: t.tooltipLabel, children: o.name }),
|
|
28
|
+
/* @__PURE__ */ e("span", { className: t.tooltipValue, children: o.value })
|
|
29
|
+
] }, o.name))
|
|
30
|
+
] });
|
|
31
|
+
}
|
|
32
|
+
function G({ payload: l }) {
|
|
33
|
+
return l.length ? /* @__PURE__ */ e("ul", { className: t.legend, role: "list", children: l.map((r) => /* @__PURE__ */ c("li", { className: t.legendItem, children: [
|
|
34
|
+
r.dashed ? /* @__PURE__ */ e("svg", { className: t.legendLineSvg, viewBox: "0 0 24 4", "aria-hidden": "true", children: /* @__PURE__ */ e("line", { x1: "0", y1: "2", x2: "24", y2: "2", stroke: r.color, strokeWidth: "2", strokeDasharray: "4 3" }) }) : /* @__PURE__ */ e("svg", { className: t.legendLineSvg, viewBox: "0 0 24 4", "aria-hidden": "true", children: /* @__PURE__ */ e("line", { x1: "0", y1: "2", x2: "24", y2: "2", stroke: r.color, strokeWidth: "2" }) }),
|
|
35
|
+
/* @__PURE__ */ e("span", { className: t.legendLabel, children: r.value })
|
|
36
|
+
] }, r.value)) }) : null;
|
|
37
|
+
}
|
|
38
|
+
function K({
|
|
39
|
+
data: l,
|
|
40
|
+
series: r,
|
|
41
|
+
yDomain: s,
|
|
42
|
+
yTicks: d,
|
|
43
|
+
reversed: h = !1,
|
|
44
|
+
referenceLine: i,
|
|
45
|
+
colorMap: o,
|
|
46
|
+
locale: k = T,
|
|
47
|
+
labels: N,
|
|
48
|
+
renderTooltipContent: u,
|
|
49
|
+
height: b = 240,
|
|
50
|
+
className: L,
|
|
51
|
+
curveType: D = "monotone"
|
|
52
|
+
}) {
|
|
53
|
+
if (!l.length)
|
|
54
|
+
return /* @__PURE__ */ e("div", { className: t.empty, role: "status", children: N.noData });
|
|
55
|
+
const f = k, y = [t.root, L].filter(Boolean).join(" "), v = r.map(({ key: a, label: n }) => ({
|
|
56
|
+
value: n ?? a,
|
|
57
|
+
color: (o == null ? void 0 : o[a]) ?? p(a)
|
|
58
|
+
}));
|
|
59
|
+
return i && v.push({
|
|
60
|
+
value: i.label,
|
|
61
|
+
color: "var(--color-chart-reference)",
|
|
62
|
+
dashed: !0
|
|
63
|
+
}), /* @__PURE__ */ c("figure", { className: y, style: { "--chart-y-axis-width": `${m}px` }, children: [
|
|
64
|
+
/* @__PURE__ */ e("div", { className: t.chart, children: /* @__PURE__ */ e(W, { width: "100%", height: b, children: /* @__PURE__ */ c(S, { data: [...l], margin: { top: 8, right: 8, bottom: 0, left: 0 }, children: [
|
|
65
|
+
/* @__PURE__ */ e(
|
|
66
|
+
C,
|
|
67
|
+
{
|
|
68
|
+
strokeDasharray: "none",
|
|
69
|
+
stroke: "var(--color-border-default, #dadbe5)",
|
|
70
|
+
strokeWidth: 1,
|
|
71
|
+
vertical: !1
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ e(
|
|
75
|
+
A,
|
|
76
|
+
{
|
|
77
|
+
dataKey: "ts",
|
|
78
|
+
type: "number",
|
|
79
|
+
scale: "time",
|
|
80
|
+
domain: ["dataMin", "dataMax"],
|
|
81
|
+
tickFormatter: (a) => x(new Date(a), "d MMM", { locale: f }),
|
|
82
|
+
tick: { fontSize: 11, fill: "var(--color-text-secondary, #555978)" },
|
|
83
|
+
axisLine: { stroke: "var(--color-border-default, #dadbe5)" },
|
|
84
|
+
tickLine: !1,
|
|
85
|
+
minTickGap: 40,
|
|
86
|
+
padding: { left: 16 }
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ e(
|
|
90
|
+
I,
|
|
91
|
+
{
|
|
92
|
+
domain: [...s],
|
|
93
|
+
ticks: d ? [...d] : void 0,
|
|
94
|
+
reversed: h,
|
|
95
|
+
tick: { fontSize: 11, fill: "var(--color-text-secondary, #555978)" },
|
|
96
|
+
axisLine: !1,
|
|
97
|
+
tickLine: !1,
|
|
98
|
+
width: m
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ e(
|
|
102
|
+
B,
|
|
103
|
+
{
|
|
104
|
+
content: (a) => {
|
|
105
|
+
const n = { ...a, locale: f };
|
|
106
|
+
return u ? u(n) : /* @__PURE__ */ e(j, { ...n });
|
|
107
|
+
},
|
|
108
|
+
cursor: { stroke: "var(--color-border-medium, #c3c5d5)", strokeWidth: 1 }
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
r.map(({ key: a, label: n }) => {
|
|
112
|
+
const w = (o == null ? void 0 : o[a]) ?? p(a);
|
|
113
|
+
return /* @__PURE__ */ e(
|
|
114
|
+
E,
|
|
115
|
+
{
|
|
116
|
+
type: D,
|
|
117
|
+
dataKey: a,
|
|
118
|
+
name: n ?? a,
|
|
119
|
+
stroke: w,
|
|
120
|
+
strokeWidth: 2,
|
|
121
|
+
dot: { r: 4, strokeWidth: 2, fill: "var(--color-surface-default, #ffffff)" },
|
|
122
|
+
activeDot: { r: 6, strokeWidth: 2 },
|
|
123
|
+
connectNulls: !0
|
|
124
|
+
},
|
|
125
|
+
a
|
|
126
|
+
);
|
|
127
|
+
}),
|
|
128
|
+
i && /* @__PURE__ */ e(
|
|
129
|
+
R,
|
|
130
|
+
{
|
|
131
|
+
y: i.value,
|
|
132
|
+
stroke: "var(--color-chart-reference)",
|
|
133
|
+
strokeDasharray: "6 4",
|
|
134
|
+
strokeWidth: 1.5,
|
|
135
|
+
label: !1,
|
|
136
|
+
ifOverflow: "extendDomain"
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
] }) }) }),
|
|
140
|
+
/* @__PURE__ */ e(G, { payload: v })
|
|
141
|
+
] });
|
|
142
|
+
}
|
|
143
|
+
export {
|
|
144
|
+
K as default
|
|
145
|
+
};
|