@peasant-labs/fairtrade 0.0.3 → 0.0.5

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 (40) hide show
  1. package/dist/lib/ChartLine-Dlp6-CLL.js +264 -0
  2. package/dist/lib/InUseShell-DZvmRdj-.js +1532 -0
  3. package/dist/lib/analytics.css +1 -0
  4. package/dist/lib/analytics.js +1052 -0
  5. package/dist/lib/commons.css +1 -0
  6. package/dist/lib/commons.js +3275 -0
  7. package/dist/lib/components.css +1 -1
  8. package/dist/lib/graph.css +1 -0
  9. package/dist/lib/graph.js +823 -0
  10. package/dist/lib/tokens.css +1 -1
  11. package/dist/lib/tokens.json +1 -1
  12. package/dist/lib/types/Intensity.d.ts +3 -3
  13. package/dist/lib/types/MapCanvas.d.ts +37 -5
  14. package/dist/lib/types/RoleRoster.d.ts +12 -1
  15. package/dist/lib/types/analytics/ChartCard.d.ts +18 -0
  16. package/dist/lib/types/analytics/ContributorTable.d.ts +16 -0
  17. package/dist/lib/types/analytics/ProjectOverview.d.ts +40 -0
  18. package/dist/lib/types/analytics/format.d.ts +48 -0
  19. package/dist/lib/types/analytics/index.d.ts +24 -0
  20. package/dist/lib/types/analytics/metrics.d.ts +130 -0
  21. package/dist/lib/types/analytics/stats.d.ts +23 -0
  22. package/dist/lib/types/analytics/time.d.ts +32 -0
  23. package/dist/lib/types/analytics/types.d.ts +453 -0
  24. package/dist/lib/types/commons/Explore.d.ts +6 -0
  25. package/dist/lib/types/commons/Manage.d.ts +34 -0
  26. package/dist/lib/types/commons/index.d.ts +24 -0
  27. package/dist/lib/types/commons/providers.d.ts +8 -0
  28. package/dist/lib/types/commons/types.d.ts +356 -0
  29. package/dist/lib/types/graph/ChangeDetail.d.ts +28 -0
  30. package/dist/lib/types/graph/Changes.d.ts +21 -0
  31. package/dist/lib/types/graph/CodeMap.d.ts +49 -0
  32. package/dist/lib/types/graph/CodeMapComposition.d.ts +85 -0
  33. package/dist/lib/types/graph/changeGraph.d.ts +106 -0
  34. package/dist/lib/types/graph/index.d.ts +30 -0
  35. package/dist/lib/types/graph/types.d.ts +579 -0
  36. package/dist/lib/types/index.d.ts +1 -0
  37. package/dist/lib/types/inuse/InUseShell.d.ts +50 -0
  38. package/dist/lib/ui-oBFnHPFe.js +11146 -0
  39. package/dist/lib/ui.js +4 -12693
  40. package/package.json +37 -6
@@ -0,0 +1,264 @@
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import { Area as n, Bar as r, BarChart as i, CartesianGrid as a, ComposedChart as o, Line as s, ResponsiveContainer as c, Tooltip as l, XAxis as u, YAxis as d } from "recharts";
3
+ //#region src/ui/chart-shared.jsx
4
+ var f = {
5
+ teal: "chart-s1",
6
+ olive: "chart-s2",
7
+ clay: "chart-s3",
8
+ mauve: "chart-s4",
9
+ amber: "chart-samber",
10
+ 1: "chart-s1",
11
+ 2: "chart-s2",
12
+ 3: "chart-s3",
13
+ 4: "chart-s4",
14
+ 1: "chart-s1",
15
+ 2: "chart-s2",
16
+ 3: "chart-s3",
17
+ 4: "chart-s4"
18
+ }, p = {
19
+ teal: "var(--chart-1)",
20
+ olive: "var(--chart-2)",
21
+ clay: "var(--chart-3)",
22
+ mauve: "var(--chart-4)",
23
+ amber: "var(--chart-amber)",
24
+ 1: "var(--chart-1)",
25
+ 2: "var(--chart-2)",
26
+ 3: "var(--chart-3)",
27
+ 4: "var(--chart-4)",
28
+ 1: "var(--chart-1)",
29
+ 2: "var(--chart-2)",
30
+ 3: "var(--chart-3)",
31
+ 4: "var(--chart-4)"
32
+ }, m = [
33
+ "teal",
34
+ "olive",
35
+ "clay",
36
+ "mauve",
37
+ "amber"
38
+ ], h = (e) => f[e] || "chart-s1", g = (e) => p[e] || "var(--chart-1)", _ = () => ({
39
+ accessibilityLayer: !0,
40
+ margin: {
41
+ top: 8,
42
+ right: 18,
43
+ bottom: 4,
44
+ left: 4
45
+ }
46
+ }), v = { isAnimationActive: !1 };
47
+ function y({ icon: n, title: r, aside: i, sub: a, legend: o, className: s = "", children: c }) {
48
+ return /* @__PURE__ */ t("figure", {
49
+ className: ["chart", s].filter(Boolean).join(" "),
50
+ children: [
51
+ (r || i) && /* @__PURE__ */ t("figcaption", {
52
+ className: "chart-head",
53
+ children: [r && /* @__PURE__ */ t("span", {
54
+ className: "chart-title",
55
+ children: [n && /* @__PURE__ */ e(n, {
56
+ className: "lucide",
57
+ "aria-hidden": "true"
58
+ }), r]
59
+ }), i && /* @__PURE__ */ e("span", {
60
+ className: "chart-aside",
61
+ children: i
62
+ })]
63
+ }),
64
+ a && /* @__PURE__ */ e("p", {
65
+ className: "chart-sub",
66
+ children: a
67
+ }),
68
+ /* @__PURE__ */ e("div", {
69
+ className: "chart-plot",
70
+ children: c
71
+ }),
72
+ o && o.length > 1 && /* @__PURE__ */ e("ul", {
73
+ className: "chart-legend",
74
+ children: o.map((n) => /* @__PURE__ */ t("li", {
75
+ className: "chart-legend-item",
76
+ children: [/* @__PURE__ */ e("span", {
77
+ className: "chart-legend-sw",
78
+ style: { background: g(n.color) },
79
+ "aria-hidden": "true"
80
+ }), n.name || n.key]
81
+ }, n.key))
82
+ })
83
+ ]
84
+ });
85
+ }
86
+ function b({ active: n, payload: r, label: i, labelFormatter: a, valueFormatter: o }) {
87
+ if (!n || !r || !r.length) return null;
88
+ let s = o || ((e) => e);
89
+ return /* @__PURE__ */ t("div", {
90
+ className: "chart-tip",
91
+ role: "status",
92
+ children: [i != null && /* @__PURE__ */ e("span", {
93
+ className: "chart-tip-k",
94
+ children: (a || ((e) => e))(i)
95
+ }), r.map((n, r) => /* @__PURE__ */ t("span", {
96
+ className: "chart-tip-row",
97
+ children: [
98
+ /* @__PURE__ */ e("span", {
99
+ className: "chart-tip-sw",
100
+ style: { background: g(n.payload?.__color?.[n.dataKey] || n.color) },
101
+ "aria-hidden": "true"
102
+ }),
103
+ n.name,
104
+ ": ",
105
+ /* @__PURE__ */ e("span", {
106
+ className: "chart-tip-v",
107
+ children: s(n.value)
108
+ })
109
+ ]
110
+ }, r))]
111
+ });
112
+ }
113
+ function x(e) {
114
+ return e.map((e, t) => ({
115
+ ...e,
116
+ color: e.color || m[t % m.length]
117
+ }));
118
+ }
119
+ //#endregion
120
+ //#region src/ui/ChartBar.jsx
121
+ function S({ data: n, xKey: o, series: s, stacked: f = !1, icon: p, title: m, aside: g, sub: S, height: C = 200, yTicks: w, xFormatter: T, valueFormatter: E, className: D = "" }) {
122
+ let O = x(s);
123
+ return /* @__PURE__ */ e(y, {
124
+ icon: p,
125
+ title: m,
126
+ aside: g,
127
+ sub: S,
128
+ legend: O,
129
+ className: D,
130
+ children: /* @__PURE__ */ e(c, {
131
+ width: "100%",
132
+ height: C,
133
+ children: /* @__PURE__ */ t(i, {
134
+ data: n,
135
+ barCategoryGap: "22%",
136
+ ..._(),
137
+ children: [
138
+ /* @__PURE__ */ e(a, { vertical: !1 }),
139
+ /* @__PURE__ */ e(u, {
140
+ dataKey: o,
141
+ tickLine: !1,
142
+ interval: 0,
143
+ tickFormatter: T,
144
+ tickMargin: 8,
145
+ minTickGap: 0
146
+ }),
147
+ /* @__PURE__ */ e(d, {
148
+ width: 28,
149
+ tickLine: !1,
150
+ axisLine: !1,
151
+ ticks: w,
152
+ allowDecimals: !1,
153
+ tickMargin: 4
154
+ }),
155
+ /* @__PURE__ */ e(l, {
156
+ cursor: { className: "chart-cursor" },
157
+ content: /* @__PURE__ */ e(b, {
158
+ valueFormatter: E,
159
+ labelFormatter: T
160
+ })
161
+ }),
162
+ O.map((t) => /* @__PURE__ */ e(r, {
163
+ dataKey: t.key,
164
+ name: t.name || t.key,
165
+ className: h(t.color),
166
+ fill: "currentColor",
167
+ stackId: f ? "stack" : void 0,
168
+ maxBarSize: 64,
169
+ radius: 0,
170
+ ...v
171
+ }, t.key))
172
+ ]
173
+ })
174
+ })
175
+ });
176
+ }
177
+ //#endregion
178
+ //#region src/ui/ChartLine.jsx
179
+ function C({ data: r, xKey: i, series: f, icon: p, title: m, aside: g, sub: S, height: C = 200, yTicks: w, xFormatter: T, valueFormatter: E, className: D = "" }) {
180
+ let O = x(f);
181
+ return /* @__PURE__ */ e(y, {
182
+ icon: p,
183
+ title: m,
184
+ aside: g,
185
+ sub: S,
186
+ legend: O,
187
+ className: D,
188
+ children: /* @__PURE__ */ e(c, {
189
+ width: "100%",
190
+ height: C,
191
+ children: /* @__PURE__ */ t(o, {
192
+ data: r,
193
+ ..._(),
194
+ children: [
195
+ /* @__PURE__ */ e(a, { vertical: !1 }),
196
+ /* @__PURE__ */ e(u, {
197
+ dataKey: i,
198
+ tickLine: !1,
199
+ interval: 0,
200
+ tickFormatter: T,
201
+ tickMargin: 8,
202
+ minTickGap: 0
203
+ }),
204
+ /* @__PURE__ */ e(d, {
205
+ width: 28,
206
+ tickLine: !1,
207
+ axisLine: !1,
208
+ ticks: w,
209
+ allowDecimals: !1,
210
+ tickMargin: 4
211
+ }),
212
+ /* @__PURE__ */ e(l, {
213
+ cursor: {
214
+ className: "chart-cursor",
215
+ strokeWidth: 0
216
+ },
217
+ content: /* @__PURE__ */ e(b, {
218
+ valueFormatter: E,
219
+ labelFormatter: T
220
+ })
221
+ }),
222
+ O.map((t) => t.area ? /* @__PURE__ */ e(n, {
223
+ dataKey: t.key,
224
+ name: t.name || t.key,
225
+ className: `${h(t.color)} chart-area`,
226
+ fill: "currentColor",
227
+ stroke: "currentColor",
228
+ strokeWidth: 2,
229
+ dot: {
230
+ className: `${h(t.color)} chart-dot`,
231
+ r: 3,
232
+ fill: "currentColor"
233
+ },
234
+ activeDot: {
235
+ className: `${h(t.color)} chart-dot`,
236
+ r: 4,
237
+ fill: "currentColor"
238
+ },
239
+ ...v
240
+ }, t.key) : /* @__PURE__ */ e(s, {
241
+ dataKey: t.key,
242
+ name: t.name || t.key,
243
+ className: `${h(t.color)} chart-line`,
244
+ stroke: "currentColor",
245
+ strokeWidth: 2,
246
+ dot: {
247
+ className: `${h(t.color)} chart-dot`,
248
+ r: 3,
249
+ fill: "currentColor"
250
+ },
251
+ activeDot: {
252
+ className: `${h(t.color)} chart-dot`,
253
+ r: 4,
254
+ fill: "currentColor"
255
+ },
256
+ ...v
257
+ }, t.key))
258
+ ]
259
+ })
260
+ })
261
+ });
262
+ }
263
+ //#endregion
264
+ export { S as n, h as r, C as t };