@elcrm/components 0.2.6 → 0.2.7
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/README.md +2 -0
- package/dist/{Dropdown-B9AodUFf.js → Dropdown-CPTE4EEx.js} +1 -1
- package/dist/Dropdown.js +1 -1
- package/dist/Healthmap-B6cdiLUl.js +243 -0
- package/dist/Healthmap.css +1 -0
- package/dist/Healthmap.d.ts +69 -0
- package/dist/Healthmap.js +4 -0
- package/dist/Layout.css +1 -1
- package/dist/Loading.css +1 -1
- package/dist/PanelInfo-A5y5ysH8.js +81 -0
- package/dist/PanelInfo.css +1 -0
- package/dist/PanelInfo.d.ts +52 -0
- package/dist/PanelInfo.js +4 -0
- package/dist/Popover-DWdvZTuA.js +135 -0
- package/dist/Popover.js +1 -1
- package/dist/{Sidebar-BSOLtF8H.js → Sidebar-1EH4XCEl.js} +1 -1
- package/dist/Sidebar.js +1 -1
- package/dist/index.css +6 -2
- package/dist/index.d.ts +5 -1
- package/dist/index.es.d.ts +5 -1
- package/dist/index.es.js +32 -27
- package/dist/overlayZ-BvHbYC1x.js +23 -0
- package/dist/tokens.css +20 -0
- package/package.json +2 -31
- package/dist/Popover-D5RymtcJ.js +0 -156
package/README.md
CHANGED
|
@@ -737,6 +737,8 @@ const resolve = createLazyResolver(
|
|
|
737
737
|
--pricing-card-min-width / --pricing-table-label-width
|
|
738
738
|
--card-pointer
|
|
739
739
|
--stack-grid-min
|
|
740
|
+
--healthmap-cell / --healthmap-gap / --healthmap-l0…l4
|
|
741
|
+
--panel-info-width / --panel-info-width-min / --panel-info-overlay-max / --panel-info-backdrop
|
|
740
742
|
--row-gap / --column-gap
|
|
741
743
|
--popup-shadow
|
|
742
744
|
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "react";
|
|
2
2
|
import { C as f } from "./CheckIcon-FdB8fMEF.js";
|
|
3
3
|
import { c as m } from "./cx-CcykAxZN.js";
|
|
4
|
-
import { P as j } from "./Popover-
|
|
4
|
+
import { P as j } from "./Popover-DWdvZTuA.js";
|
|
5
5
|
import { u as I } from "./useControllableValue-CWqH1kpM.js";
|
|
6
6
|
import './Dropdown.css';const M = "crr", P = "crt", R = "crc", W = "crp", z = "crh", F = "crg", G = "crd", T = "cri", V = "crn", q = "crm", A = "crk", H = "crl", J = "cru", K = "crb", Q = "cro", U = "crf", X = "crx", Y = "cry", Z = "crv", n = {
|
|
7
7
|
r: M,
|
package/dist/Dropdown.js
CHANGED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import e, { useState as L, useMemo as Y, useEffect as X } from "react";
|
|
2
|
+
import { createPortal as ee } from "react-dom";
|
|
3
|
+
import { c as j } from "./cx-CcykAxZN.js";
|
|
4
|
+
import './Healthmap.css';const te = "hAr", ne = "hAc", se = "hAa", ae = "hAh", le = "hAt", ce = "hAm", re = "hAo", oe = "hAn", me = "hAd", ie = "hAw", ue = "hAk", he = "hAe", pe = "hAf", Ee = "hAi", fe = "hAg", ge = "hAb", ye = "hAp", be = "hAq", ve = "hAv", Ne = "hAl", de = "hAz", Te = "hAj", Ae = "hAu", ke = "hAx", we = "hAs", De = "hAy", n = {
|
|
5
|
+
r: te,
|
|
6
|
+
c: ne,
|
|
7
|
+
a: se,
|
|
8
|
+
h: ae,
|
|
9
|
+
t: le,
|
|
10
|
+
m: ce,
|
|
11
|
+
o: re,
|
|
12
|
+
n: oe,
|
|
13
|
+
d: me,
|
|
14
|
+
w: ie,
|
|
15
|
+
k: ue,
|
|
16
|
+
e: he,
|
|
17
|
+
f: pe,
|
|
18
|
+
i: Ee,
|
|
19
|
+
g: fe,
|
|
20
|
+
b: ge,
|
|
21
|
+
p: ye,
|
|
22
|
+
q: be,
|
|
23
|
+
v: ve,
|
|
24
|
+
l: Ne,
|
|
25
|
+
z: de,
|
|
26
|
+
j: Te,
|
|
27
|
+
u: Ae,
|
|
28
|
+
x: ke,
|
|
29
|
+
s: we,
|
|
30
|
+
y: De
|
|
31
|
+
}, f = 5, _ = 12, B = 3, z = _ + B, Ue = [
|
|
32
|
+
"янв",
|
|
33
|
+
"фев",
|
|
34
|
+
"мар",
|
|
35
|
+
"апр",
|
|
36
|
+
"май",
|
|
37
|
+
"июн",
|
|
38
|
+
"июл",
|
|
39
|
+
"авг",
|
|
40
|
+
"сен",
|
|
41
|
+
"окт",
|
|
42
|
+
"ноя",
|
|
43
|
+
"дек"
|
|
44
|
+
], xe = {
|
|
45
|
+
one: "действие",
|
|
46
|
+
few: "действия",
|
|
47
|
+
many: "действий"
|
|
48
|
+
};
|
|
49
|
+
function x(t) {
|
|
50
|
+
const [l, a, m] = t.split("-").map(Number);
|
|
51
|
+
return new Date(Date.UTC(l, a - 1, m));
|
|
52
|
+
}
|
|
53
|
+
function Ce(t, l) {
|
|
54
|
+
if (t <= 0) return 0;
|
|
55
|
+
if (l <= 1) return 4;
|
|
56
|
+
const a = t / l;
|
|
57
|
+
return a > 0.75 ? 4 : a > 0.5 ? 3 : a > 0.25 ? 2 : 1;
|
|
58
|
+
}
|
|
59
|
+
function T(t, l) {
|
|
60
|
+
const a = t % 10, m = t % 100;
|
|
61
|
+
return a === 1 && m !== 11 ? l.one : a >= 2 && a <= 4 && (m < 10 || m >= 20) ? l.few : l.many;
|
|
62
|
+
}
|
|
63
|
+
function $e(t) {
|
|
64
|
+
return T(t, { one: "день", few: "дня", many: "дней" });
|
|
65
|
+
}
|
|
66
|
+
function H(t) {
|
|
67
|
+
return x(t).toLocaleDateString("ru-RU", {
|
|
68
|
+
weekday: "long",
|
|
69
|
+
day: "numeric",
|
|
70
|
+
month: "long",
|
|
71
|
+
year: "numeric",
|
|
72
|
+
timeZone: "UTC"
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function Me(t) {
|
|
76
|
+
let l = 0;
|
|
77
|
+
for (let a = t.length - 1; a >= 0; a--) {
|
|
78
|
+
if (t[a].count <= 0) {
|
|
79
|
+
if (l === 0) continue;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
l++;
|
|
83
|
+
}
|
|
84
|
+
return l;
|
|
85
|
+
}
|
|
86
|
+
function Re({
|
|
87
|
+
data: t,
|
|
88
|
+
loading: l = !1,
|
|
89
|
+
year: a = null,
|
|
90
|
+
onYearChange: m,
|
|
91
|
+
hint: G,
|
|
92
|
+
brandName: O = "Активность",
|
|
93
|
+
brandSub: I = "сводка",
|
|
94
|
+
unit: A = xe,
|
|
95
|
+
className: Z
|
|
96
|
+
}) {
|
|
97
|
+
const [g, k] = L(0), [p, w] = L(null), i = Y(() => {
|
|
98
|
+
var P;
|
|
99
|
+
if (!((P = t == null ? void 0 : t.days) != null && P.length))
|
|
100
|
+
return {
|
|
101
|
+
weeks: [],
|
|
102
|
+
months: [],
|
|
103
|
+
streak: 0,
|
|
104
|
+
activeDays: 0,
|
|
105
|
+
bestDay: 0
|
|
106
|
+
};
|
|
107
|
+
const s = Math.max(1, ...t.days.map((o) => o.count)), h = new Map(t.days.map((o) => [o.date, o.count])), c = x(t.from), u = x(t.to), M = c.getUTCDay(), Q = M === 0 ? -6 : 1 - M, r = new Date(c);
|
|
108
|
+
r.setUTCDate(r.getUTCDate() + Q);
|
|
109
|
+
const E = [], S = [];
|
|
110
|
+
let F = -1;
|
|
111
|
+
for (; r.getTime() <= u.getTime() || E.length === 0; ) {
|
|
112
|
+
const o = [];
|
|
113
|
+
for (let U = 0; U < 7; U++) {
|
|
114
|
+
const V = r.getUTCFullYear(), N = r.getUTCMonth(), W = r.getUTCDate(), R = `${V}-${String(N + 1).padStart(2, "0")}-${String(W).padStart(2, "0")}`, d = r.getTime() >= c.getTime() && r.getTime() <= u.getTime(), q = d ? h.get(R) ?? 0 : 0;
|
|
115
|
+
U === 0 && d && N !== F && (S.push({ label: Ue[N], col: E.length }), F = N), o.push({
|
|
116
|
+
date: R,
|
|
117
|
+
count: d ? q : 0,
|
|
118
|
+
level: d ? Ce(q, s) : 0
|
|
119
|
+
}), r.setUTCDate(r.getUTCDate() + 1);
|
|
120
|
+
}
|
|
121
|
+
if (E.push(o), r.getTime() > u.getTime() && E.length >= 52 || E.length > 60) break;
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
weeks: E,
|
|
125
|
+
months: S,
|
|
126
|
+
streak: Me(t.days),
|
|
127
|
+
activeDays: t.days.filter((o) => o.count > 0).length,
|
|
128
|
+
bestDay: Math.max(0, ...t.days.map((o) => o.count))
|
|
129
|
+
};
|
|
130
|
+
}, [t]), y = Y(() => {
|
|
131
|
+
var h;
|
|
132
|
+
const s = (h = t == null ? void 0 : t.years) != null && h.length ? [...t.years] : [(/* @__PURE__ */ new Date()).getUTCFullYear(), (/* @__PURE__ */ new Date()).getUTCFullYear() - 1];
|
|
133
|
+
return [...new Set(s)].sort((c, u) => u - c);
|
|
134
|
+
}, [t == null ? void 0 : t.years]), D = (/* @__PURE__ */ new Date()).getUTCFullYear(), b = a ?? (t == null ? void 0 : t.year) ?? D, C = (t == null ? void 0 : t.total) ?? 0, v = Math.max(1, Math.ceil(y.length / f));
|
|
135
|
+
X(() => {
|
|
136
|
+
const s = y.indexOf(b);
|
|
137
|
+
s < 0 || k(Math.floor(s / f));
|
|
138
|
+
}, [b, y]);
|
|
139
|
+
const J = y.slice(
|
|
140
|
+
g * f,
|
|
141
|
+
g * f + f
|
|
142
|
+
);
|
|
143
|
+
function $(s, h) {
|
|
144
|
+
const c = h.getBoundingClientRect();
|
|
145
|
+
w({
|
|
146
|
+
date: s.date,
|
|
147
|
+
count: s.count,
|
|
148
|
+
x: c.left + c.width / 2,
|
|
149
|
+
y: c.top
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
const K = l ? "Загрузка…" : `${C} ${T(C, A)} за ${a == null || a === D ? "последний год" : `${a} год`}`;
|
|
153
|
+
return /* @__PURE__ */ e.createElement("div", { className: j(n.r, Z) }, /* @__PURE__ */ e.createElement("section", { className: n.c, "aria-label": "Календарь активности" }, /* @__PURE__ */ e.createElement("div", { className: n.h }, /* @__PURE__ */ e.createElement("h3", { className: n.t }, K)), /* @__PURE__ */ e.createElement(
|
|
154
|
+
"div",
|
|
155
|
+
{
|
|
156
|
+
className: n.m,
|
|
157
|
+
"aria-hidden": !0,
|
|
158
|
+
style: {
|
|
159
|
+
width: i.weeks.length ? i.weeks.length * z - B : void 0
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
i.months.map((s) => /* @__PURE__ */ e.createElement(
|
|
163
|
+
"span",
|
|
164
|
+
{
|
|
165
|
+
key: `${s.label}-${s.col}`,
|
|
166
|
+
className: n.o,
|
|
167
|
+
style: { left: s.col * z }
|
|
168
|
+
},
|
|
169
|
+
s.label
|
|
170
|
+
))
|
|
171
|
+
), /* @__PURE__ */ e.createElement("div", { className: n.n }, /* @__PURE__ */ e.createElement("div", { className: n.d, "aria-hidden": !0 }, /* @__PURE__ */ e.createElement("span", null, "Пн"), /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("span", null, "Ср"), /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("span", null, "Пт"), /* @__PURE__ */ e.createElement("span", null), /* @__PURE__ */ e.createElement("span", null)), /* @__PURE__ */ e.createElement(
|
|
172
|
+
"div",
|
|
173
|
+
{
|
|
174
|
+
className: n.w,
|
|
175
|
+
style: {
|
|
176
|
+
gridTemplateColumns: `repeat(${i.weeks.length}, ${_}px)`
|
|
177
|
+
},
|
|
178
|
+
role: "grid",
|
|
179
|
+
"aria-label": "График активности"
|
|
180
|
+
},
|
|
181
|
+
i.weeks.map((s, h) => /* @__PURE__ */ e.createElement("div", { key: h, className: n.k, role: "row" }, s.map((c) => /* @__PURE__ */ e.createElement(
|
|
182
|
+
"button",
|
|
183
|
+
{
|
|
184
|
+
key: c.date,
|
|
185
|
+
type: "button",
|
|
186
|
+
className: n.e,
|
|
187
|
+
"data-level": c.level,
|
|
188
|
+
role: "gridcell",
|
|
189
|
+
"aria-label": `${H(c.date)}: ${c.count} ${T(c.count, A)}`,
|
|
190
|
+
onMouseEnter: (u) => $(c, u.currentTarget),
|
|
191
|
+
onMouseLeave: () => w(null),
|
|
192
|
+
onFocus: (u) => $(c, u.currentTarget),
|
|
193
|
+
onBlur: () => w(null)
|
|
194
|
+
}
|
|
195
|
+
))))
|
|
196
|
+
)), /* @__PURE__ */ e.createElement("div", { className: n.f }, /* @__PURE__ */ e.createElement("span", { className: n.i }, G ?? ""), /* @__PURE__ */ e.createElement("nav", { className: n.z, "aria-label": "Год" }, v > 1 ? /* @__PURE__ */ e.createElement(
|
|
197
|
+
"button",
|
|
198
|
+
{
|
|
199
|
+
type: "button",
|
|
200
|
+
className: n.u,
|
|
201
|
+
"aria-label": "Предыдущие годы",
|
|
202
|
+
disabled: g <= 0,
|
|
203
|
+
onClick: () => k((s) => Math.max(0, s - 1))
|
|
204
|
+
},
|
|
205
|
+
"‹"
|
|
206
|
+
) : null, /* @__PURE__ */ e.createElement("div", { className: n.j, role: "tablist" }, J.map((s) => /* @__PURE__ */ e.createElement(
|
|
207
|
+
"button",
|
|
208
|
+
{
|
|
209
|
+
key: s,
|
|
210
|
+
type: "button",
|
|
211
|
+
role: "tab",
|
|
212
|
+
"aria-selected": s === b,
|
|
213
|
+
className: j(n.x, s === b && n.s),
|
|
214
|
+
onClick: () => m == null ? void 0 : m(s === D ? null : s)
|
|
215
|
+
},
|
|
216
|
+
s
|
|
217
|
+
))), v > 1 ? /* @__PURE__ */ e.createElement(
|
|
218
|
+
"button",
|
|
219
|
+
{
|
|
220
|
+
type: "button",
|
|
221
|
+
className: n.u,
|
|
222
|
+
"aria-label": "Следующие годы",
|
|
223
|
+
disabled: g >= v - 1,
|
|
224
|
+
onClick: () => k((s) => Math.min(v - 1, s + 1))
|
|
225
|
+
},
|
|
226
|
+
"›"
|
|
227
|
+
) : null), /* @__PURE__ */ e.createElement("div", { className: n.g, "aria-hidden": !0 }, /* @__PURE__ */ e.createElement("span", null, "Меньше"), [0, 1, 2, 3, 4].map((s) => /* @__PURE__ */ e.createElement("span", { key: s, className: n.e, "data-level": s })), /* @__PURE__ */ e.createElement("span", null, "Больше")))), /* @__PURE__ */ e.createElement("aside", { className: n.a, "aria-label": "Сводка" }, /* @__PURE__ */ e.createElement("div", { className: n.b }, /* @__PURE__ */ e.createElement("span", null, O), /* @__PURE__ */ e.createElement("span", null, I)), /* @__PURE__ */ e.createElement("div", { className: n.p }, /* @__PURE__ */ e.createElement("div", { className: n.q }, /* @__PURE__ */ e.createElement("span", { className: n.v }, l ? "—" : i.streak), /* @__PURE__ */ e.createElement("span", { className: n.l }, "серия, ", $e(i.streak))), /* @__PURE__ */ e.createElement("div", { className: n.q }, /* @__PURE__ */ e.createElement("span", { className: n.v }, l ? "—" : i.activeDays), /* @__PURE__ */ e.createElement("span", { className: n.l }, "активных дней")), /* @__PURE__ */ e.createElement("div", { className: n.q }, /* @__PURE__ */ e.createElement("span", { className: n.v }, l ? "—" : i.bestDay), /* @__PURE__ */ e.createElement("span", { className: n.l }, "макс. за день")))), p ? ee(
|
|
228
|
+
/* @__PURE__ */ e.createElement(
|
|
229
|
+
"div",
|
|
230
|
+
{
|
|
231
|
+
className: n.y,
|
|
232
|
+
style: { left: p.x, top: p.y },
|
|
233
|
+
role: "tooltip"
|
|
234
|
+
},
|
|
235
|
+
/* @__PURE__ */ e.createElement("div", null, H(p.date)),
|
|
236
|
+
/* @__PURE__ */ e.createElement("div", null, p.count, " ", T(p.count, A))
|
|
237
|
+
),
|
|
238
|
+
document.body
|
|
239
|
+
) : null);
|
|
240
|
+
}
|
|
241
|
+
export {
|
|
242
|
+
Re as H
|
|
243
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer elcrm-components{.hAr{display:flex;gap:var(--shell-gap);align-items:stretch;width:100%}.hAc,.hAa{border:1px solid var(--shell-border);border-radius:var(--shell-radius);background:var(--shell-background);box-sizing:border-box}.hAc{flex:1;min-width:0;display:flex;flex-direction:column;padding:var(--shell-gap-lg) var(--shell-padding-inline);overflow-x:auto}.hAh{margin-bottom:var(--shell-gap-sm)}.hAt{margin:0;font-size:var(--shell-font-size);font-weight:var(--shell-font-weight);color:var(--shell-color)}.hAm{position:relative;margin:0 0 4px 26px;height:16px;font-size:11px;color:var(--shell-color-muted)}.hAo{position:absolute;top:0;white-space:nowrap}.hAn{display:flex;gap:4px;align-items:flex-start;flex:1}.hAd{display:grid;grid-template-rows:repeat(7,var(--healthmap-cell));gap:var(--healthmap-gap);width:22px;font-size:10px;line-height:var(--healthmap-cell);color:var(--shell-color-muted);flex-shrink:0;align-content:center}.hAw{display:grid;gap:var(--healthmap-gap);align-content:center}.hAk{display:grid;grid-template-rows:repeat(7,var(--healthmap-cell));gap:var(--healthmap-gap)}.hAe{width:var(--healthmap-cell);height:var(--healthmap-cell);padding:0;border:0;border-radius:2px;background:var(--healthmap-l0);box-sizing:border-box;cursor:default;display:block}.hAe:focus-visible{outline:2px solid var(--shell-color-accent);outline-offset:1px}.hAe[data-level="1"]{background:var(--healthmap-l1)}.hAe[data-level="2"]{background:var(--healthmap-l2)}.hAe[data-level="3"]{background:var(--healthmap-l3)}.hAe[data-level="4"]{background:var(--healthmap-l4)}.hAf{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:10px;margin-top:auto;padding-top:10px;margin-left:26px;font-size:11px;color:var(--shell-color-muted)}.hAi{min-width:0}.hAg{display:flex;align-items:center;gap:4px;justify-self:end}.hAa{flex:0 0 180px;display:flex;flex-direction:column;gap:var(--shell-gap-lg);padding:var(--shell-gap-lg) 18px}.hAb{display:flex;flex-direction:column;gap:2px;line-height:1.2}.hAb>span:first-child{font-size:var(--shell-font-size-lg);font-weight:700;letter-spacing:-.02em;color:var(--shell-color)}.hAb>span:last-child{font-size:11px;color:var(--shell-color-muted);text-transform:uppercase;letter-spacing:.04em}.hAp{display:flex;flex-direction:column;gap:var(--shell-gap-sm);flex:1;justify-content:center}.hAq{display:flex;flex-direction:column;gap:2px}.hAv{font-size:20px;font-weight:650;font-variant-numeric:tabular-nums;letter-spacing:-.03em;color:var(--shell-color);line-height:1.1}.hAl{font-size:var(--shell-font-size-sm);color:var(--shell-color-muted)}.hAz{display:flex;align-items:center;justify-content:center;gap:4px;justify-self:center}.hAj{display:flex;align-items:center;gap:4px}.hAu{width:28px;height:28px;border:0;border-radius:var(--shell-radius);background:transparent;color:var(--shell-color-muted);font-size:18px;line-height:1;cursor:pointer}.hAu:hover:not(:disabled){color:var(--shell-color);background:var(--shell-background-muted)}.hAu:disabled{opacity:var(--shell-disabled-opacity);cursor:default}.hAx{border:0;background:transparent;color:var(--shell-color-muted);font-size:var(--shell-font-size-sm);padding:5px 11px;border-radius:999px;cursor:pointer}.hAx:hover{color:var(--shell-color)}.hAs{background:var(--shell-color-accent);color:var(--shell-background)}.hAy{position:fixed;z-index:calc(var(--shell-z) + 50);transform:translate(-50%,calc(-100% - 10px));min-width:160px;max-width:280px;padding:var(--shell-gap-sm) var(--shell-gap);border-radius:var(--shell-radius);background:var(--shell-background);border:1px solid var(--shell-border);box-shadow:var(--popup-shadow);pointer-events:none;color:var(--shell-color)}.hAy>:first-child{font-size:var(--shell-font-size-sm);color:var(--shell-color-muted)}.hAy>:last-child{font-size:var(--shell-font-size);font-weight:600}@media (max-width: 720px){.hAr{flex-direction:column}.hAa{flex:none;width:100%}.hAf{grid-template-columns:1fr;margin-left:0;justify-items:start}.hAg,.hAz{justify-self:start}}}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** День теплокарты: дата `yyyy-mm-dd` и счётчик. */
|
|
3
|
+
export type HealthmapDay = {
|
|
4
|
+
date: string;
|
|
5
|
+
count: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Данные теплокарты (как ответ heatmap-RPC).
|
|
9
|
+
* Компонент не ходит в API — данные даёт приложение.
|
|
10
|
+
*/
|
|
11
|
+
export type HealthmapData = {
|
|
12
|
+
total: number;
|
|
13
|
+
from: string;
|
|
14
|
+
to: string;
|
|
15
|
+
year: number;
|
|
16
|
+
years: number[];
|
|
17
|
+
days: HealthmapDay[];
|
|
18
|
+
};
|
|
19
|
+
/** Склонение единиц («действие» / «событие»). */
|
|
20
|
+
export type HealthmapUnit = {
|
|
21
|
+
one: string;
|
|
22
|
+
few: string;
|
|
23
|
+
many: string;
|
|
24
|
+
};
|
|
25
|
+
export type HealthmapProps = {
|
|
26
|
+
/** Данные года; `null` — пустая сетка. */
|
|
27
|
+
data: HealthmapData | null;
|
|
28
|
+
/** Показать «Загрузка…» в заголовке. */
|
|
29
|
+
loading?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Выбранный год. `null` — «последний год» (как в ответе сервера).
|
|
32
|
+
* Контролируемый режим: вместе с `onYearChange`.
|
|
33
|
+
*/
|
|
34
|
+
year?: number | null;
|
|
35
|
+
/** Смена года (клик по вкладке). */
|
|
36
|
+
onYearChange?: (year: number | null) => void;
|
|
37
|
+
/** Подсказка под сеткой. */
|
|
38
|
+
hint?: string;
|
|
39
|
+
/** Бренд в боковой колонке KPI. */
|
|
40
|
+
brandName?: string;
|
|
41
|
+
/** Подпись под брендом. */
|
|
42
|
+
brandSub?: string;
|
|
43
|
+
/** Единицы для склонения счётчиков. */
|
|
44
|
+
unit?: HealthmapUnit;
|
|
45
|
+
/** Доп. CSS-класс. */
|
|
46
|
+
className?: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Теплокарта активности по дням (как GitHub contribution graph).
|
|
50
|
+
*
|
|
51
|
+
* Роли: Healthmap = визуализация `days[]`; данные грузит приложение
|
|
52
|
+
* (`Api.query` / свой RPC), не сам компонент.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* <Healthmap
|
|
57
|
+
* data={heatmap}
|
|
58
|
+
* loading={pending}
|
|
59
|
+
* year={year}
|
|
60
|
+
* onYearChange={setYear}
|
|
61
|
+
* brandName="eKivi"
|
|
62
|
+
* brandSub="клиенты"
|
|
63
|
+
* unit={{ one: "событие", few: "события", many: "событий" }}
|
|
64
|
+
* />
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* Токены: `--shell-*`, `--healthmap-cell`, `--healthmap-gap`, `--healthmap-l0`…`--healthmap-l4`.
|
|
68
|
+
*/
|
|
69
|
+
export declare function Healthmap({ data, loading, year, onYearChange, hint, brandName, brandSub, unit, className, }: HealthmapProps): React.JSX.Element;
|
package/dist/Layout.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer elcrm-components{.clr{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;box-sizing:border-box;background:var(--shell-background-muted);margin:var(--layout-margin);padding:var(--layout-padding);max-width:var(--layout-max-width);gap:0}.clx{height:var(--layout-height, 100dvh);max-height:var(--layout-height, 100dvh);overflow:hidden}.clm{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain}.clr:not(.clx){height:auto;max-height:none;overflow:visible}.clr:not(.clx) .clm{overflow:visible;flex:0 1 auto;min-height:auto}.cls{flex-direction:row;align-items:stretch}.clb{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0;overflow:hidden}.clr:not(.clx) .clb{overflow:visible}.cla{display:flex;flex-direction:column;flex:0 0 var(--sidebar-width, 248px);width:var(--sidebar-width, 248px);min-width:0;min-height:0;align-self:stretch}.clk{overflow:hidden}.cla:not(.clk){overflow:auto}.cla>*{flex:1 1 auto;min-height:0;width:100%;height:100%;max-height:100%}@media (max-width: 900px){.cla{flex-basis:72px;width:72px}}.clh,.clf{flex:0 0 auto;min-width:0}}
|
|
1
|
+
@layer elcrm-components{.clr{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;box-sizing:border-box;background:var(--shell-background-muted);margin:var(--layout-margin);padding:var(--layout-padding);max-width:var(--layout-max-width);gap:0}.clx{height:var(--layout-height, 100dvh);max-height:var(--layout-height, 100dvh);overflow:hidden}.clm{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain}.clr:not(.clx){height:auto;max-height:none;overflow:visible}.clr:not(.clx) .clm{overflow:visible;flex:0 1 auto;min-height:auto}.cls{flex-direction:row;align-items:stretch;gap:var(--layout-gap, 0)}.clb{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0;overflow:hidden;background:var(--layout-main-background, transparent);border-radius:var(--layout-main-radius, 0);box-shadow:var(--layout-main-shadow, none);border:var(--layout-main-border, none)}.clr:not(.clx) .clb{overflow:visible}.cla{display:flex;flex-direction:column;flex:0 0 var(--sidebar-width, 248px);width:var(--sidebar-width, 248px);min-width:0;min-height:0;align-self:stretch}.clk{overflow:hidden}.cla:not(.clk){overflow:auto}.cla>*{flex:1 1 auto;min-height:0;width:100%;height:100%;max-height:100%}@media (max-width: 900px){.cla{flex-basis:72px;width:72px}}.clh,.clf{flex:0 0 auto;min-width:0}}
|
package/dist/Loading.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer elcrm-components{.cgr{display:flex;align-items:center;justify-content:center;gap:var(--shell-gap-sm);padding:var(--shell-gap-lg);color:var(--shell-color-muted)}.cgi{box-sizing:border-box;width:var(--shell-icon-size);height:var(--shell-icon-size);border:2px solid var(--shell-border);border-top-color:var(--shell-color-accent);border-radius:var(--avatar-radius);animation:
|
|
1
|
+
@layer elcrm-components{.cgr{display:flex;align-items:center;justify-content:center;gap:var(--shell-gap-sm);padding:var(--shell-gap-lg);color:var(--shell-color-muted)}.cgi{box-sizing:border-box;width:var(--shell-icon-size);height:var(--shell-icon-size);border:2px solid var(--shell-border);border-top-color:var(--shell-color-accent);border-radius:var(--avatar-radius);animation:cgk .7s linear infinite}}@keyframes cgk{to{transform:rotate(360deg)}}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import { T as b } from "./TextGroup-DmhuyMR1.js";
|
|
3
|
+
import { c as h } from "./cx-CcykAxZN.js";
|
|
4
|
+
import { a as B, r as N } from "./overlayZ-BvHbYC1x.js";
|
|
5
|
+
import './PanelInfo.css';const x = "pBr", g = "pBs", k = "pBh", I = "pBt", L = "pBa", O = "pBc", z = "pBb", M = "pBf", S = "pBd", n = {
|
|
6
|
+
r: x,
|
|
7
|
+
s: g,
|
|
8
|
+
h: k,
|
|
9
|
+
t: I,
|
|
10
|
+
a: L,
|
|
11
|
+
c: O,
|
|
12
|
+
b: z,
|
|
13
|
+
f: M,
|
|
14
|
+
d: S
|
|
15
|
+
}, m = "(max-width: 56rem)";
|
|
16
|
+
function T({
|
|
17
|
+
open: a,
|
|
18
|
+
title: s,
|
|
19
|
+
onClose: o,
|
|
20
|
+
children: f,
|
|
21
|
+
footer: l,
|
|
22
|
+
headerExtra: u,
|
|
23
|
+
close: v,
|
|
24
|
+
"aria-label": y,
|
|
25
|
+
className: E
|
|
26
|
+
}) {
|
|
27
|
+
const [r, p] = e.useState(
|
|
28
|
+
() => typeof window < "u" ? window.matchMedia(m).matches : !1
|
|
29
|
+
), [i, d] = e.useState();
|
|
30
|
+
e.useEffect(() => {
|
|
31
|
+
const t = window.matchMedia(m), c = () => p(t.matches);
|
|
32
|
+
return c(), t.addEventListener("change", c), () => t.removeEventListener("change", c);
|
|
33
|
+
}, []), e.useEffect(() => {
|
|
34
|
+
if (!a || !r) {
|
|
35
|
+
d(void 0);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const t = B();
|
|
39
|
+
return d(t), () => {
|
|
40
|
+
N(t), d(void 0);
|
|
41
|
+
};
|
|
42
|
+
}, [a, r]), e.useEffect(() => {
|
|
43
|
+
if (!a) return;
|
|
44
|
+
const t = (c) => {
|
|
45
|
+
c.key === "Escape" && (c.preventDefault(), o());
|
|
46
|
+
};
|
|
47
|
+
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
48
|
+
}, [a, o]), e.useEffect(() => {
|
|
49
|
+
if (!a || !r) return;
|
|
50
|
+
const t = document.body.style.overflow;
|
|
51
|
+
return document.body.style.overflow = "hidden", () => {
|
|
52
|
+
document.body.style.overflow = t;
|
|
53
|
+
};
|
|
54
|
+
}, [a, r]);
|
|
55
|
+
const w = y ?? (typeof s == "string" && s.trim() ? s : "Панель");
|
|
56
|
+
return /* @__PURE__ */ e.createElement(
|
|
57
|
+
"aside",
|
|
58
|
+
{
|
|
59
|
+
className: h(n.r, E),
|
|
60
|
+
"data-open": a ? "true" : "false",
|
|
61
|
+
"data-overlay": r ? "true" : "false",
|
|
62
|
+
"aria-hidden": !a,
|
|
63
|
+
"aria-label": a ? w : void 0,
|
|
64
|
+
style: i != null ? { zIndex: i } : void 0
|
|
65
|
+
},
|
|
66
|
+
a && r ? /* @__PURE__ */ e.createElement("div", { className: n.d, role: "presentation", onClick: o }) : null,
|
|
67
|
+
/* @__PURE__ */ e.createElement("div", { className: n.s }, /* @__PURE__ */ e.createElement("div", { className: n.h }, /* @__PURE__ */ e.createElement("div", { className: n.t }, typeof s == "string" || typeof s == "number" ? /* @__PURE__ */ e.createElement(b, { title: String(s), size: "m" }) : s), /* @__PURE__ */ e.createElement("div", { className: n.a }, u, v ?? /* @__PURE__ */ e.createElement(
|
|
68
|
+
"button",
|
|
69
|
+
{
|
|
70
|
+
type: "button",
|
|
71
|
+
className: n.c,
|
|
72
|
+
"aria-label": "Закрыть",
|
|
73
|
+
onClick: o
|
|
74
|
+
},
|
|
75
|
+
"×"
|
|
76
|
+
))), /* @__PURE__ */ e.createElement("div", { className: n.b }, f), l != null ? /* @__PURE__ */ e.createElement("div", { className: n.f }, l) : null)
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
T as P
|
|
81
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer elcrm-components{.pBr{flex:0 0 auto;position:relative;width:0;min-width:0;min-height:0;align-self:stretch;overflow:hidden;opacity:0;pointer-events:none;transition:width .22s ease,opacity .18s ease,min-width .22s ease}.pBr[data-open=true]{width:var(--panel-info-width);min-width:var(--panel-info-width-min);opacity:1;pointer-events:auto}.pBs{display:flex;flex-direction:column;height:100%;min-height:0;width:var(--panel-info-width);min-width:var(--panel-info-width-min);box-sizing:border-box;border:var(--chat-border);border-radius:var(--chat-radius);background:var(--chat-background);color:var(--shell-color)}.pBh{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:var(--shell-gap-sm);padding:var(--shell-gap);border-bottom:var(--chat-border)}.pBt{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pBa{flex:0 0 auto;display:flex;align-items:center;gap:.25rem}.pBc{width:2rem;height:2rem;border:0;border-radius:var(--shell-radius);background:transparent;color:var(--shell-color-muted);font-size:1.35rem;line-height:1;cursor:pointer}.pBc:hover{color:var(--shell-color);background:var(--shell-background-muted)}.pBb{flex:1 1 auto;min-height:0;overflow:auto;padding:var(--shell-gap)}.pBf{flex:0 0 auto;padding:var(--shell-gap);border-top:var(--chat-border)}.pBd{display:none}@media (max-width: 56rem){.pBr[data-open=true]{width:0;min-width:0;opacity:1;overflow:visible;pointer-events:none}.pBr[data-open=true] .pBd{display:block;position:fixed;top:0;right:0;bottom:0;left:0;z-index:inherit;pointer-events:auto;background:var(--panel-info-backdrop);cursor:pointer}.pBr[data-open=true] .pBs{position:fixed;top:0;right:0;bottom:0;z-index:inherit;width:min(100vw,var(--panel-info-overlay-max));min-width:0;max-width:100vw;border-radius:0;border-left:var(--chat-border);border-right:none;border-top:none;border-bottom:none;pointer-events:auto;box-shadow:var(--popup-shadow)}}}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type PanelInfoProps = {
|
|
3
|
+
/** Открыта ли панель. */
|
|
4
|
+
open: boolean;
|
|
5
|
+
/** Заголовок шапки. */
|
|
6
|
+
title: React.ReactNode;
|
|
7
|
+
/** Закрытие: крестик / фон / Escape. */
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
/**
|
|
10
|
+
* Тело — форма (`@elcrm/form` поля) или любой контент.
|
|
11
|
+
* Скроллится между шапкой и footer.
|
|
12
|
+
*/
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Низ вне скролла — обычно `Stack` + `@elcrm/button`
|
|
16
|
+
* («Отмена» / «Сохранить»).
|
|
17
|
+
*/
|
|
18
|
+
footer?: React.ReactNode;
|
|
19
|
+
/** Доп. действия в шапке слева от крестика. */
|
|
20
|
+
headerExtra?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Слот кнопки закрытия. По умолчанию — крестик.
|
|
23
|
+
* Приложение может подставить `@elcrm/button`.
|
|
24
|
+
*/
|
|
25
|
+
close?: React.ReactNode;
|
|
26
|
+
/** `aria-label` для `<aside>`, если title не строка. */
|
|
27
|
+
"aria-label"?: string;
|
|
28
|
+
/** Доп. CSS-класс. */
|
|
29
|
+
className?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Выезжающая панель справа: шапка / body / footer.
|
|
33
|
+
*
|
|
34
|
+
* Широкий экран — flex-колонка рядом со списком.
|
|
35
|
+
* Узкий (`max-width: 56rem`) — поверх контента с затемнением
|
|
36
|
+
* и `acquireOverlayZIndex`.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* <PanelInfo
|
|
41
|
+
* open={!!row}
|
|
42
|
+
* title={row?.name ?? ""}
|
|
43
|
+
* onClose={() => setId(null)}
|
|
44
|
+
* footer={<Button width="l" label="Сохранить" onSend={onSave} />}
|
|
45
|
+
* >
|
|
46
|
+
* <StringField name="name" form={form} label="Название" />
|
|
47
|
+
* </PanelInfo>
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* Токены: `--panel-info-width`, `--panel-info-backdrop`, `--shell-*`, `--chat-*`.
|
|
51
|
+
*/
|
|
52
|
+
export declare function PanelInfo({ open, title, onClose, children, footer, headerExtra, close, "aria-label": ariaLabel, className, }: PanelInfoProps): React.JSX.Element;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import u, { useRef as E, useId as Y, useState as N, useLayoutEffect as O, useEffect as S } from "react";
|
|
2
|
+
import { createPortal as _ } from "react-dom";
|
|
3
|
+
import { c as T } from "./cx-CcykAxZN.js";
|
|
4
|
+
import { a as $, r as V } from "./overlayZ-BvHbYC1x.js";
|
|
5
|
+
import { u as ee } from "./useControllableValue-CWqH1kpM.js";
|
|
6
|
+
import './Popover.css';const te = "c3r", ne = "c3t", oe = "c3p", H = {
|
|
7
|
+
r: te,
|
|
8
|
+
t: ne,
|
|
9
|
+
p: oe
|
|
10
|
+
};
|
|
11
|
+
function ie(t, e) {
|
|
12
|
+
const c = (e == null ? void 0 : e.querySelector("button, a, [role='button']")) ?? (e == null ? void 0 : e.firstElementChild);
|
|
13
|
+
return (c instanceof HTMLElement ? c : e ?? t).getBoundingClientRect();
|
|
14
|
+
}
|
|
15
|
+
function re(t, e) {
|
|
16
|
+
return t != null && t.top === e.top && t.left === e.left && t.minWidth === e.minWidth && t.maxHeight === e.maxHeight;
|
|
17
|
+
}
|
|
18
|
+
function se(t, e, c, p) {
|
|
19
|
+
if (!u.isValidElement(t)) return t;
|
|
20
|
+
const d = t.props.onClick;
|
|
21
|
+
return u.cloneElement(t, {
|
|
22
|
+
"aria-haspopup": "menu",
|
|
23
|
+
"aria-expanded": e,
|
|
24
|
+
"aria-controls": e ? c : void 0,
|
|
25
|
+
onClick: (h) => {
|
|
26
|
+
d == null || d(h), p();
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function fe({
|
|
31
|
+
trigger: t,
|
|
32
|
+
children: e,
|
|
33
|
+
open: c,
|
|
34
|
+
defaultOpen: p = !1,
|
|
35
|
+
onOpenChange: d,
|
|
36
|
+
align: h = "end",
|
|
37
|
+
placement: w = "auto",
|
|
38
|
+
disabled: W = !1,
|
|
39
|
+
label: Z,
|
|
40
|
+
role: D = "menu",
|
|
41
|
+
className: F,
|
|
42
|
+
panelClassName: K
|
|
43
|
+
}) {
|
|
44
|
+
const x = E(null), b = E(null), g = E(null), y = Y(), [i = !1, j] = ee(
|
|
45
|
+
c,
|
|
46
|
+
p,
|
|
47
|
+
d
|
|
48
|
+
), [m, P] = N(null), [a, k] = N(null), L = E(null);
|
|
49
|
+
L.current = a;
|
|
50
|
+
const M = (o) => {
|
|
51
|
+
W && o || j(o);
|
|
52
|
+
};
|
|
53
|
+
O(() => {
|
|
54
|
+
if (i) {
|
|
55
|
+
a == null && k($());
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
a != null && (V(a), k(null));
|
|
59
|
+
}, [i, a]), S(() => () => {
|
|
60
|
+
L.current != null && V(L.current);
|
|
61
|
+
}, []);
|
|
62
|
+
const R = () => {
|
|
63
|
+
var A;
|
|
64
|
+
const o = x.current;
|
|
65
|
+
if (!o) return;
|
|
66
|
+
const n = ie(o, b.current), r = 8, l = 8, s = ((A = g.current) == null ? void 0 : A.offsetHeight) ?? 0, f = window.innerHeight - n.bottom - r - l, J = n.top - r - l, Q = s > 0 ? s : 160, I = w === "bottom" || w !== "top" && f >= Q, U = Math.min(
|
|
67
|
+
420,
|
|
68
|
+
Math.max(120, I ? f : J)
|
|
69
|
+
), v = Math.max(200, n.width), X = h === "end" ? Math.max(8, Math.min(n.right - v, window.innerWidth - v - 8)) : Math.max(8, Math.min(n.left, window.innerWidth - v - 8)), q = { top: I ? n.bottom + r : Math.max(l, n.top - r - (s > 0 ? s : 0)), left: X, minWidth: v, maxHeight: U };
|
|
70
|
+
P((B) => re(B, q) ? B : q);
|
|
71
|
+
};
|
|
72
|
+
O(() => {
|
|
73
|
+
if (!i) {
|
|
74
|
+
P(null);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
R();
|
|
78
|
+
const o = window.requestAnimationFrame(() => R()), n = () => R();
|
|
79
|
+
return window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), () => {
|
|
80
|
+
window.cancelAnimationFrame(o), window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
|
|
81
|
+
};
|
|
82
|
+
}, [i, h, w, e]), S(() => {
|
|
83
|
+
if (!i) return;
|
|
84
|
+
const o = (r) => {
|
|
85
|
+
var s, f;
|
|
86
|
+
const l = r.target;
|
|
87
|
+
(s = x.current) != null && s.contains(l) || (f = g.current) != null && f.contains(l) || M(!1);
|
|
88
|
+
}, n = (r) => {
|
|
89
|
+
r.key === "Escape" && M(!1);
|
|
90
|
+
};
|
|
91
|
+
return document.addEventListener("mousedown", o), document.addEventListener("keydown", n), () => {
|
|
92
|
+
document.removeEventListener("mousedown", o), document.removeEventListener("keydown", n);
|
|
93
|
+
};
|
|
94
|
+
}, [i]);
|
|
95
|
+
const G = {
|
|
96
|
+
position: "fixed",
|
|
97
|
+
zIndex: a ?? 1e3,
|
|
98
|
+
...m ? {
|
|
99
|
+
top: m.top,
|
|
100
|
+
bottom: "auto",
|
|
101
|
+
left: m.left,
|
|
102
|
+
minWidth: m.minWidth,
|
|
103
|
+
maxHeight: m.maxHeight
|
|
104
|
+
} : { visibility: "hidden", pointerEvents: "none" }
|
|
105
|
+
}, z = i ? /* @__PURE__ */ u.createElement(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
ref: g,
|
|
109
|
+
id: y,
|
|
110
|
+
role: D,
|
|
111
|
+
"aria-label": Z,
|
|
112
|
+
className: T(H.p, K),
|
|
113
|
+
style: G,
|
|
114
|
+
onMouseDown: (o) => o.stopPropagation()
|
|
115
|
+
},
|
|
116
|
+
e
|
|
117
|
+
) : null, C = () => {
|
|
118
|
+
W || M(!i);
|
|
119
|
+
};
|
|
120
|
+
return /* @__PURE__ */ u.createElement("div", { ref: x, className: T(H.r, F) }, /* @__PURE__ */ u.createElement(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
ref: b,
|
|
124
|
+
className: H.t,
|
|
125
|
+
"aria-haspopup": "menu",
|
|
126
|
+
"aria-expanded": i,
|
|
127
|
+
"aria-controls": i ? y : void 0,
|
|
128
|
+
onClick: u.isValidElement(t) ? void 0 : C
|
|
129
|
+
},
|
|
130
|
+
se(t, i, y, C)
|
|
131
|
+
), z && typeof document < "u" ? _(z, document.body) : null);
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
fe as P
|
|
135
|
+
};
|
package/dist/Popover.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "react";
|
|
2
2
|
import { B as h } from "./Badge-jp-9iNNL.js";
|
|
3
|
-
import { D as w } from "./Dropdown-
|
|
3
|
+
import { D as w } from "./Dropdown-CPTE4EEx.js";
|
|
4
4
|
import { I as y } from "./Item-D4okhsfW.js";
|
|
5
5
|
import { b as C } from "./badgeText-CRzlIzi3.js";
|
|
6
6
|
import { c as u } from "./cx-CcykAxZN.js";
|
package/dist/Sidebar.js
CHANGED
package/dist/index.css
CHANGED
|
@@ -24,15 +24,17 @@
|
|
|
24
24
|
|
|
25
25
|
@layer elcrm-components{.chr{display:flex;align-items:center;gap:var(--shell-gap);flex-shrink:0;min-height:var(--header-height);padding:var(--shell-padding);color:var(--shell-color);background:var(--shell-background);border:var(--header-border);border-radius:var(--header-radius);box-shadow:var(--header-shadow);margin:var(--header-margin);position:relative;z-index:var(--header-z)}.chn{display:flex;flex:1;align-items:center;min-width:0;justify-content:var(--header-nav-justify)}.cha{display:flex;align-items:center;gap:var(--shell-gap-sm);flex-shrink:0;margin:auto}}
|
|
26
26
|
|
|
27
|
+
@layer elcrm-components{.hAr{display:flex;gap:var(--shell-gap);align-items:stretch;width:100%}.hAc,.hAa{border:1px solid var(--shell-border);border-radius:var(--shell-radius);background:var(--shell-background);box-sizing:border-box}.hAc{flex:1;min-width:0;display:flex;flex-direction:column;padding:var(--shell-gap-lg) var(--shell-padding-inline);overflow-x:auto}.hAh{margin-bottom:var(--shell-gap-sm)}.hAt{margin:0;font-size:var(--shell-font-size);font-weight:var(--shell-font-weight);color:var(--shell-color)}.hAm{position:relative;margin:0 0 4px 26px;height:16px;font-size:11px;color:var(--shell-color-muted)}.hAo{position:absolute;top:0;white-space:nowrap}.hAn{display:flex;gap:4px;align-items:flex-start;flex:1}.hAd{display:grid;grid-template-rows:repeat(7,var(--healthmap-cell));gap:var(--healthmap-gap);width:22px;font-size:10px;line-height:var(--healthmap-cell);color:var(--shell-color-muted);flex-shrink:0;align-content:center}.hAw{display:grid;gap:var(--healthmap-gap);align-content:center}.hAk{display:grid;grid-template-rows:repeat(7,var(--healthmap-cell));gap:var(--healthmap-gap)}.hAe{width:var(--healthmap-cell);height:var(--healthmap-cell);padding:0;border:0;border-radius:2px;background:var(--healthmap-l0);box-sizing:border-box;cursor:default;display:block}.hAe:focus-visible{outline:2px solid var(--shell-color-accent);outline-offset:1px}.hAe[data-level="1"]{background:var(--healthmap-l1)}.hAe[data-level="2"]{background:var(--healthmap-l2)}.hAe[data-level="3"]{background:var(--healthmap-l3)}.hAe[data-level="4"]{background:var(--healthmap-l4)}.hAf{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:10px;margin-top:auto;padding-top:10px;margin-left:26px;font-size:11px;color:var(--shell-color-muted)}.hAi{min-width:0}.hAg{display:flex;align-items:center;gap:4px;justify-self:end}.hAa{flex:0 0 180px;display:flex;flex-direction:column;gap:var(--shell-gap-lg);padding:var(--shell-gap-lg) 18px}.hAb{display:flex;flex-direction:column;gap:2px;line-height:1.2}.hAb>span:first-child{font-size:var(--shell-font-size-lg);font-weight:700;letter-spacing:-.02em;color:var(--shell-color)}.hAb>span:last-child{font-size:11px;color:var(--shell-color-muted);text-transform:uppercase;letter-spacing:.04em}.hAp{display:flex;flex-direction:column;gap:var(--shell-gap-sm);flex:1;justify-content:center}.hAq{display:flex;flex-direction:column;gap:2px}.hAv{font-size:20px;font-weight:650;font-variant-numeric:tabular-nums;letter-spacing:-.03em;color:var(--shell-color);line-height:1.1}.hAl{font-size:var(--shell-font-size-sm);color:var(--shell-color-muted)}.hAz{display:flex;align-items:center;justify-content:center;gap:4px;justify-self:center}.hAj{display:flex;align-items:center;gap:4px}.hAu{width:28px;height:28px;border:0;border-radius:var(--shell-radius);background:transparent;color:var(--shell-color-muted);font-size:18px;line-height:1;cursor:pointer}.hAu:hover:not(:disabled){color:var(--shell-color);background:var(--shell-background-muted)}.hAu:disabled{opacity:var(--shell-disabled-opacity);cursor:default}.hAx{border:0;background:transparent;color:var(--shell-color-muted);font-size:var(--shell-font-size-sm);padding:5px 11px;border-radius:999px;cursor:pointer}.hAx:hover{color:var(--shell-color)}.hAs{background:var(--shell-color-accent);color:var(--shell-background)}.hAy{position:fixed;z-index:calc(var(--shell-z) + 50);transform:translate(-50%,calc(-100% - 10px));min-width:160px;max-width:280px;padding:var(--shell-gap-sm) var(--shell-gap);border-radius:var(--shell-radius);background:var(--shell-background);border:1px solid var(--shell-border);box-shadow:var(--popup-shadow);pointer-events:none;color:var(--shell-color)}.hAy>:first-child{font-size:var(--shell-font-size-sm);color:var(--shell-color-muted)}.hAy>:last-child{font-size:var(--shell-font-size);font-weight:600}@media (max-width: 720px){.hAr{flex-direction:column}.hAa{flex:none;width:100%}.hAf{grid-template-columns:1fr;margin-left:0;justify-items:start}.hAg,.hAz{justify-self:start}}}
|
|
28
|
+
|
|
27
29
|
@layer elcrm-components{.cir{display:flex;align-items:center;gap:var(--shell-gap-sm);padding:var(--shell-padding);color:var(--shell-color);background:transparent;border:1px solid transparent;border-radius:var(--shell-radius);cursor:default}.cir:is(button,a){-webkit-appearance:none;-moz-appearance:none;appearance:none;font:inherit;text-align:left;width:100%;cursor:pointer}.cir:hover{background:var(--shell-background-hover)}.cia,.cir[aria-current=true],.cir[data-active=true]{background:var(--shell-background-selected)}.cic{align-items:flex-start;gap:var(--shell-gap);padding:var(--shell-padding);border:1px solid var(--shell-border);border-radius:var(--shell-radius);background:var(--shell-background-muted);flex-shrink:0}.cic:hover,.cic.cia,.cic[data-active=true]{background:color-mix(in srgb,var(--shell-color-accent) 12%,var(--shell-background-muted));border-color:color-mix(in srgb,var(--shell-color-accent) 35%,transparent)}}
|
|
28
30
|
|
|
29
31
|
@layer elcrm-components{.c7r{display:flex;align-items:flex-start;gap:var(--item-column-gap);min-width:0;width:100%;text-align:left}.c7i{flex-shrink:0;box-sizing:border-box;width:var(--item-column-icon-size);height:var(--item-column-icon-size);border-radius:var(--item-column-icon-radius);display:inline-flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--shell-color-accent) 14%,transparent);color:var(--shell-color-accent)}.c7b{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.c7h{display:flex;align-items:center;gap:8px;min-width:0}.c7t{flex:1;min-width:0;margin:0;font-size:var(--item-column-title-size);font-weight:var(--shell-font-weight);color:var(--shell-color);line-height:var(--item-column-title-line);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c7x{flex-shrink:0;display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px}.c7d{margin:0;font-size:var(--shell-font-size-sm);font-weight:400;color:var(--shell-color);line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.c7f{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 6px;font-size:12px;color:var(--shell-color-muted);line-height:1.35}.c7p{opacity:.5;-webkit-user-select:none;user-select:none}.c7a{flex-shrink:0;display:inline-flex;align-items:flex-start}.c7s .c7t{font-size:var(--shell-font-size-sm)}.c7s .c7d{font-size:12px}.c7l .c7t{font-size:var(--shell-font-size-lg)}.c7l .c7d{font-size:var(--shell-font-size)}.c7k .c7t{font-weight:700}}
|
|
30
32
|
|
|
31
|
-
@layer elcrm-components{.clr{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;box-sizing:border-box;background:var(--shell-background-muted);margin:var(--layout-margin);padding:var(--layout-padding);max-width:var(--layout-max-width);gap:0}.clx{height:var(--layout-height, 100dvh);max-height:var(--layout-height, 100dvh);overflow:hidden}.clm{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain}.clr:not(.clx){height:auto;max-height:none;overflow:visible}.clr:not(.clx) .clm{overflow:visible;flex:0 1 auto;min-height:auto}.cls{flex-direction:row;align-items:stretch}.clb{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0;overflow:hidden}.clr:not(.clx) .clb{overflow:visible}.cla{display:flex;flex-direction:column;flex:0 0 var(--sidebar-width, 248px);width:var(--sidebar-width, 248px);min-width:0;min-height:0;align-self:stretch}.clk{overflow:hidden}.cla:not(.clk){overflow:auto}.cla>*{flex:1 1 auto;min-height:0;width:100%;height:100%;max-height:100%}@media (max-width: 900px){.cla{flex-basis:72px;width:72px}}.clh,.clf{flex:0 0 auto;min-width:0}}
|
|
33
|
+
@layer elcrm-components{.clr{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;box-sizing:border-box;background:var(--shell-background-muted);margin:var(--layout-margin);padding:var(--layout-padding);max-width:var(--layout-max-width);gap:0}.clx{height:var(--layout-height, 100dvh);max-height:var(--layout-height, 100dvh);overflow:hidden}.clm{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain}.clr:not(.clx){height:auto;max-height:none;overflow:visible}.clr:not(.clx) .clm{overflow:visible;flex:0 1 auto;min-height:auto}.cls{flex-direction:row;align-items:stretch;gap:var(--layout-gap, 0)}.clb{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0;overflow:hidden;background:var(--layout-main-background, transparent);border-radius:var(--layout-main-radius, 0);box-shadow:var(--layout-main-shadow, none);border:var(--layout-main-border, none)}.clr:not(.clx) .clb{overflow:visible}.cla{display:flex;flex-direction:column;flex:0 0 var(--sidebar-width, 248px);width:var(--sidebar-width, 248px);min-width:0;min-height:0;align-self:stretch}.clk{overflow:hidden}.cla:not(.clk){overflow:auto}.cla>*{flex:1 1 auto;min-height:0;width:100%;height:100%;max-height:100%}@media (max-width: 900px){.cla{flex-basis:72px;width:72px}}.clh,.clf{flex:0 0 auto;min-width:0}}
|
|
32
34
|
|
|
33
35
|
@layer elcrm-components{.csr{display:flex;flex-direction:column;gap:var(--shell-gap-sm);padding:0;margin:0;list-style:none}.csh{flex-direction:row;flex-wrap:wrap}}
|
|
34
36
|
|
|
35
|
-
@layer elcrm-components{.cgr{display:flex;align-items:center;justify-content:center;gap:var(--shell-gap-sm);padding:var(--shell-gap-lg);color:var(--shell-color-muted)}.cgi{box-sizing:border-box;width:var(--shell-icon-size);height:var(--shell-icon-size);border:2px solid var(--shell-border);border-top-color:var(--shell-color-accent);border-radius:var(--avatar-radius);animation:
|
|
37
|
+
@layer elcrm-components{.cgr{display:flex;align-items:center;justify-content:center;gap:var(--shell-gap-sm);padding:var(--shell-gap-lg);color:var(--shell-color-muted)}.cgi{box-sizing:border-box;width:var(--shell-icon-size);height:var(--shell-icon-size);border:2px solid var(--shell-border);border-top-color:var(--shell-color-accent);border-radius:var(--avatar-radius);animation:cgk .7s linear infinite}}@keyframes cgk{to{transform:rotate(360deg)}}
|
|
36
38
|
|
|
37
39
|
@layer elcrm-components{.cmr{display:flex;align-items:center;gap:var(--shell-gap-sm);margin:0;padding:0;list-style:none}.cmv{flex-direction:column;align-items:stretch}.cmi{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;border:0;background:transparent;color:var(--button-color-muted);padding:var(--button-padding);border-radius:var(--button-radius);font:inherit;line-height:1;cursor:pointer;text-align:left;gap:var(--shell-gap-sm)}.cmd{flex-shrink:0;min-width:16px;height:16px;padding:0 4px;font-size:10px}.cmi>svg{display:block;flex-shrink:0}.cmi:hover{background:var(--button-background-hover);color:var(--button-color)}.cma,.cmi[aria-current=page],.cmi[data-active=true]{background:var(--button-background-selected);color:var(--button-color)}.cmu{width:100%;align-items:stretch;gap:1.25rem;padding:0;border-bottom:1px solid var(--shell-border)}.cmu .cmi{border-radius:0;background:transparent;padding:.45rem .1rem .55rem;border-bottom:2px solid transparent;margin-bottom:-1px}.cmu .cmi:hover{background:transparent;color:var(--shell-color)}.cmu .cma,.cmu .cmi[aria-current=page],.cmu .cmi[data-active=true]{background:transparent;color:var(--shell-color);border-bottom-color:var(--shell-color-accent)}}
|
|
38
40
|
|
|
@@ -42,6 +44,8 @@
|
|
|
42
44
|
|
|
43
45
|
@layer elcrm-components{.ckr{flex:1 1 auto;min-height:0;height:100%;width:100%;display:flex;flex-direction:column;box-sizing:border-box;padding:var(--shell-padding);overflow:hidden}.ckw{max-width:none}.ckb{flex:1 1 auto;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:var(--shell-gap)}.ckf{flex:0 0 auto;padding-top:var(--shell-gap-sm)}.cko{overflow:visible;height:auto}.cko .ckb{overflow:visible;flex:0 1 auto;min-height:auto}}
|
|
44
46
|
|
|
47
|
+
@layer elcrm-components{.pBr{flex:0 0 auto;position:relative;width:0;min-width:0;min-height:0;align-self:stretch;overflow:hidden;opacity:0;pointer-events:none;transition:width .22s ease,opacity .18s ease,min-width .22s ease}.pBr[data-open=true]{width:var(--panel-info-width);min-width:var(--panel-info-width-min);opacity:1;pointer-events:auto}.pBs{display:flex;flex-direction:column;height:100%;min-height:0;width:var(--panel-info-width);min-width:var(--panel-info-width-min);box-sizing:border-box;border:var(--chat-border);border-radius:var(--chat-radius);background:var(--chat-background);color:var(--shell-color)}.pBh{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:var(--shell-gap-sm);padding:var(--shell-gap);border-bottom:var(--chat-border)}.pBt{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pBa{flex:0 0 auto;display:flex;align-items:center;gap:.25rem}.pBc{width:2rem;height:2rem;border:0;border-radius:var(--shell-radius);background:transparent;color:var(--shell-color-muted);font-size:1.35rem;line-height:1;cursor:pointer}.pBc:hover{color:var(--shell-color);background:var(--shell-background-muted)}.pBb{flex:1 1 auto;min-height:0;overflow:auto;padding:var(--shell-gap)}.pBf{flex:0 0 auto;padding:var(--shell-gap);border-top:var(--chat-border)}.pBd{display:none}@media (max-width: 56rem){.pBr[data-open=true]{width:0;min-width:0;opacity:1;overflow:visible;pointer-events:none}.pBr[data-open=true] .pBd{display:block;position:fixed;top:0;right:0;bottom:0;left:0;z-index:inherit;pointer-events:auto;background:var(--panel-info-backdrop);cursor:pointer}.pBr[data-open=true] .pBs{position:fixed;top:0;right:0;bottom:0;z-index:inherit;width:min(100vw,var(--panel-info-overlay-max));min-width:0;max-width:100vw;border-radius:0;border-left:var(--chat-border);border-right:none;border-top:none;border-bottom:none;pointer-events:auto;box-shadow:var(--popup-shadow)}}}
|
|
48
|
+
|
|
45
49
|
@layer elcrm-components{.c3r{position:relative;display:inline-flex;vertical-align:middle}.c3t{display:inline-flex;align-items:center;min-width:0;height:auto}.c3p{box-sizing:border-box;overflow:auto;padding:var(--shell-gap-sm);background:var(--shell-background);border:1px solid var(--shell-border);border-radius:var(--shell-radius);box-shadow:var(--popup-shadow);color:var(--shell-color);min-width:var(--dropdown-min-width);max-width:var(--dropdown-max-width);max-height:var(--dropdown-max-height)}}
|
|
46
50
|
|
|
47
51
|
@layer elcrm-components{.cur{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--pricing-card-min-width),1fr));gap:var(--shell-gap-lg);align-items:stretch}.cui{position:relative;display:flex;flex-direction:column;gap:var(--shell-gap);padding:var(--shell-padding);box-sizing:border-box;text-align:left;font:inherit;color:var(--shell-color);background:var(--shell-background);border:1px solid var(--shell-border);border-radius:var(--shell-radius);box-shadow:var(--shell-shadow)}.cui[data-selectable=true]{cursor:pointer}.cui:disabled,.cui[aria-disabled=true]{opacity:var(--shell-disabled-opacity);cursor:not-allowed}.cus,.cui[data-selected=true],.cui[data-highlighted=true]{border-color:var(--shell-color-accent);background:var(--shell-background-selected);box-shadow:var(--shell-shadow)}.cub{display:flex;align-items:center;justify-content:center;margin:calc(-1 * var(--shell-padding-block)) calc(-1 * var(--shell-padding-inline)) 0;padding:var(--shell-gap-sm) var(--shell-padding-inline);border-radius:var(--shell-radius) var(--shell-radius) 0 0;background:var(--shell-color-accent);color:var(--avatar-color);font-size:var(--shell-font-size-sm);font-weight:var(--shell-font-weight);text-align:center}.cug{display:inline-flex;align-items:center;width:fit-content;padding:.15rem .5rem;border-radius:999px;background:var(--shell-background-hover);color:var(--shell-color-accent);font-size:var(--shell-font-size-sm);font-weight:var(--shell-font-weight);line-height:1.2}.cua{position:absolute;top:0;left:50%;transform:translate(-50%,-50%)}.cum{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:calc(var(--shell-icon-size) * 1.6);height:calc(var(--shell-icon-size) * 1.6);color:var(--shell-color-accent);background:var(--shell-background-hover);border-radius:50%;overflow:hidden}.cuh{display:flex;flex-wrap:wrap;align-items:center;gap:var(--shell-gap-sm)}.cut{margin:0;font-size:var(--shell-font-size);font-weight:var(--shell-font-weight);color:var(--shell-color);line-height:1.3}.cup{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--shell-gap-sm)}.cuz{font-size:calc(var(--shell-font-size-lg) * 1.35);font-weight:700;color:var(--shell-color);line-height:1.15}.cui[data-highlighted=true] .cuz,.cui[data-selected=true] .cuz{color:var(--shell-color-accent)}.cuo{font-size:var(--shell-font-size-sm);color:var(--shell-color-muted);text-decoration:line-through}.cue{font-size:var(--shell-font-size-sm);color:var(--shell-color-muted)}.cud{margin:0;font-size:var(--shell-font-size-sm);color:var(--shell-color-muted);line-height:1.45}.cux{display:flex;flex-direction:column;gap:var(--shell-gap-sm)}.cuf{display:flex;flex-direction:column;gap:var(--shell-gap-sm);margin:auto calc(-1 * var(--shell-padding-inline)) calc(-1 * var(--shell-padding-block));padding:var(--shell-padding);background:var(--shell-background-muted);border-top:1px solid var(--shell-border);border-radius:0 0 var(--shell-radius) var(--shell-radius)}.cuy{display:flex;flex-direction:column;gap:var(--shell-gap-sm);margin-top:auto}.cul{margin:0;font-size:var(--shell-font-size-sm);font-weight:var(--shell-font-weight);letter-spacing:.04em;text-transform:uppercase;color:var(--shell-color-muted)}.cuu{margin:0;font-size:var(--shell-font-size-sm);color:var(--shell-color-muted);line-height:1.4}.cun{display:flex;flex-direction:column;gap:var(--shell-gap-sm);margin:0;padding:0;list-style:none}.cuc{display:flex;align-items:flex-start;gap:var(--shell-gap-sm);font-size:var(--shell-font-size-sm);color:var(--shell-color);line-height:1.4}.cuk{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--shell-check-size);height:var(--shell-check-size);margin-top:.1em;color:var(--avatar-color);background:var(--shell-color-success);border-radius:50%}.cuw{width:60%;height:60%;display:block}}
|
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export type { StackProps, StackDirection, StackColumns } from './Stack';
|
|
|
30
30
|
export { Menu } from './Menu';
|
|
31
31
|
export type { MenuProps, MenuItem } from './Menu';
|
|
32
32
|
export { Dropdown } from './Dropdown';
|
|
33
|
-
export type { DropdownProps, DropdownItem, DropdownGroup
|
|
33
|
+
export type { DropdownProps, DropdownItem, DropdownGroup } from './Dropdown';
|
|
34
34
|
export { Breadcrumb } from './Breadcrumb';
|
|
35
35
|
export type { BreadcrumbProps, BreadcrumbItem, BreadcrumbSeparator, } from './Breadcrumb';
|
|
36
36
|
export { Loading } from './Loading';
|
|
@@ -75,6 +75,10 @@ export { Sidebar } from './Sidebar';
|
|
|
75
75
|
export type { SidebarProps, SidebarGroup, SidebarItem, SidebarVariant, } from './Sidebar';
|
|
76
76
|
export { Popover } from './Popover';
|
|
77
77
|
export type { PopoverProps, PopoverPlacement } from './Popover';
|
|
78
|
+
export { Healthmap } from './Healthmap';
|
|
79
|
+
export type { HealthmapProps, HealthmapData, HealthmapDay, HealthmapUnit, } from './Healthmap';
|
|
80
|
+
export { PanelInfo } from './PanelInfo';
|
|
81
|
+
export type { PanelInfoProps } from './PanelInfo';
|
|
78
82
|
export { acquireOverlayZIndex, releaseOverlayZIndex, peekOverlayZIndex, } from './overlayZ';
|
|
79
83
|
export { createLazyResolver } from './lazyRoute';
|
|
80
84
|
export type { LazyRouteChunk } from './lazyRoute';
|
package/dist/index.es.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export type { StackProps, StackDirection, StackColumns } from './Stack';
|
|
|
30
30
|
export { Menu } from './Menu';
|
|
31
31
|
export type { MenuProps, MenuItem } from './Menu';
|
|
32
32
|
export { Dropdown } from './Dropdown';
|
|
33
|
-
export type { DropdownProps, DropdownItem, DropdownGroup
|
|
33
|
+
export type { DropdownProps, DropdownItem, DropdownGroup } from './Dropdown';
|
|
34
34
|
export { Breadcrumb } from './Breadcrumb';
|
|
35
35
|
export type { BreadcrumbProps, BreadcrumbItem, BreadcrumbSeparator, } from './Breadcrumb';
|
|
36
36
|
export { Loading } from './Loading';
|
|
@@ -75,6 +75,10 @@ export { Sidebar } from './Sidebar';
|
|
|
75
75
|
export type { SidebarProps, SidebarGroup, SidebarItem, SidebarVariant, } from './Sidebar';
|
|
76
76
|
export { Popover } from './Popover';
|
|
77
77
|
export type { PopoverProps, PopoverPlacement } from './Popover';
|
|
78
|
+
export { Healthmap } from './Healthmap';
|
|
79
|
+
export type { HealthmapProps, HealthmapData, HealthmapDay, HealthmapUnit, } from './Healthmap';
|
|
80
|
+
export { PanelInfo } from './PanelInfo';
|
|
81
|
+
export type { PanelInfoProps } from './PanelInfo';
|
|
78
82
|
export { acquireOverlayZIndex, releaseOverlayZIndex, peekOverlayZIndex, } from './overlayZ';
|
|
79
83
|
export { createLazyResolver } from './lazyRoute';
|
|
80
84
|
export type { LazyRouteChunk } from './lazyRoute';
|
package/dist/index.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { L as x } from "./Layout-mi6Ghayv.js";
|
|
2
2
|
import { H as i } from "./Header-DZQopVNy.js";
|
|
3
|
-
import { F as
|
|
3
|
+
import { F as l } from "./Footer-qxUlnPR9.js";
|
|
4
4
|
import { L as u } from "./List-BgKkYaGO.js";
|
|
5
5
|
import { I as S } from "./Item-D4okhsfW.js";
|
|
6
|
-
import { I as
|
|
6
|
+
import { I as P } from "./ItemColumn-M7a9L8CI.js";
|
|
7
7
|
import { C as y } from "./Card-hn37Opo3.js";
|
|
8
8
|
import { A as B } from "./ActionGroup-ChKFW0mt.js";
|
|
9
|
-
import { T as
|
|
9
|
+
import { T as L } from "./TextGroup-DmhuyMR1.js";
|
|
10
10
|
import { S as R } from "./Stat-sKXJwz5L.js";
|
|
11
11
|
import { B as G } from "./Block-Bu7NEA0g.js";
|
|
12
|
-
import { R as
|
|
13
|
-
import { C as
|
|
14
|
-
import { S as
|
|
12
|
+
import { R as b } from "./Row-DsQOVn18.js";
|
|
13
|
+
import { C as k } from "./Column-BiogBDf8.js";
|
|
14
|
+
import { S as N, s as M } from "./Stack-XkmPSswj.js";
|
|
15
15
|
import { M as Z } from "./Menu-DuXQv-zT.js";
|
|
16
|
-
import { D as z } from "./Dropdown-
|
|
16
|
+
import { D as z } from "./Dropdown-CPTE4EEx.js";
|
|
17
17
|
import { B as E } from "./Breadcrumb-CAM_e9LN.js";
|
|
18
18
|
import { L as j } from "./Loading-DkkG7RcE.js";
|
|
19
19
|
import { S as K } from "./Section-Crxk2J-E.js";
|
|
@@ -26,17 +26,20 @@ import { B as sr } from "./Badge-jp-9iNNL.js";
|
|
|
26
26
|
import { B as mr } from "./Brand-Zq-Idks4.js";
|
|
27
27
|
import { E as fr } from "./EmptyState-mBiWtMIM.js";
|
|
28
28
|
import { R as nr } from "./RadioGroup-fcXzhvMu.js";
|
|
29
|
-
import { P as
|
|
29
|
+
import { P as cr } from "./PricingGroup-Czuhe81Z.js";
|
|
30
30
|
import { P as dr } from "./PricingTable-BuLC0opK.js";
|
|
31
31
|
import { P as Cr } from "./PageHead-DgaJ1mXY.js";
|
|
32
|
-
import { P as
|
|
32
|
+
import { P as vr } from "./PageShell-D9EZiO8o.js";
|
|
33
33
|
import { C as Ar, a as Br } from "./ChatSplit-DNnu3TNq.js";
|
|
34
|
-
import { C as
|
|
34
|
+
import { C as Lr } from "./ChatFrame-BW2TmCkZ.js";
|
|
35
35
|
import { C as Rr } from "./ChatMessages-B8rdXiK-.js";
|
|
36
|
-
import { S as Gr } from "./Sidebar-
|
|
37
|
-
import { P as
|
|
36
|
+
import { S as Gr } from "./Sidebar-1EH4XCEl.js";
|
|
37
|
+
import { P as br } from "./Popover-DWdvZTuA.js";
|
|
38
|
+
import { H as kr } from "./Healthmap-B6cdiLUl.js";
|
|
39
|
+
import { P as Nr } from "./PanelInfo-A5y5ysH8.js";
|
|
40
|
+
import { a as Or, p as Zr, r as wr } from "./overlayZ-BvHbYC1x.js";
|
|
38
41
|
import { lazy as e } from "react";
|
|
39
|
-
import { c as
|
|
42
|
+
import { c as Dr } from "./cx-CcykAxZN.js";
|
|
40
43
|
function s(a) {
|
|
41
44
|
const o = {};
|
|
42
45
|
return (r) => (o[r] || (o[r] = e(() => a(r))), o[r]);
|
|
@@ -51,41 +54,43 @@ export {
|
|
|
51
54
|
mr as Brand,
|
|
52
55
|
E as Breadcrumb,
|
|
53
56
|
y as Card,
|
|
54
|
-
|
|
57
|
+
Lr as ChatFrame,
|
|
55
58
|
Ar as ChatList,
|
|
56
59
|
Rr as ChatMessages,
|
|
57
60
|
Br as ChatSplit,
|
|
58
|
-
|
|
61
|
+
k as Column,
|
|
59
62
|
z as Dropdown,
|
|
60
63
|
fr as EmptyState,
|
|
61
|
-
|
|
64
|
+
l as Footer,
|
|
62
65
|
i as Header,
|
|
66
|
+
kr as Healthmap,
|
|
63
67
|
S as Item,
|
|
64
|
-
|
|
68
|
+
P as ItemColumn,
|
|
65
69
|
x as Layout,
|
|
66
70
|
u as List,
|
|
67
71
|
j as Loading,
|
|
68
72
|
Z as Menu,
|
|
69
73
|
U as NavSections,
|
|
70
74
|
Cr as PageHead,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
vr as PageShell,
|
|
76
|
+
Nr as PanelInfo,
|
|
77
|
+
br as Popover,
|
|
78
|
+
cr as PricingGroup,
|
|
74
79
|
dr as PricingTable,
|
|
75
80
|
nr as RadioGroup,
|
|
76
|
-
|
|
81
|
+
b as Row,
|
|
77
82
|
K as Section,
|
|
78
83
|
Gr as Sidebar,
|
|
79
|
-
|
|
84
|
+
N as Stack,
|
|
80
85
|
R as Stat,
|
|
81
86
|
W as TabSections,
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
L as TextGroup,
|
|
88
|
+
Or as acquireOverlayZIndex,
|
|
84
89
|
_ as avatarRadiusStyle,
|
|
85
90
|
s as createLazyResolver,
|
|
86
|
-
|
|
91
|
+
Dr as cx,
|
|
87
92
|
$ as initialsFromName,
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
Zr as peekOverlayZIndex,
|
|
94
|
+
wr as releaseOverlayZIndex,
|
|
90
95
|
M as stackColumnsTemplate
|
|
91
96
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function a() {
|
|
2
|
+
const e = globalThis;
|
|
3
|
+
return e.elcrm || (e.elcrm = {}), e.elcrm.overlayZ || (e.elcrm.overlayZ = { seq: 0, active: /* @__PURE__ */ new Set() }), e.elcrm.overlayZ;
|
|
4
|
+
}
|
|
5
|
+
function c() {
|
|
6
|
+
const e = a();
|
|
7
|
+
e.seq += 1;
|
|
8
|
+
const t = 1e3 + e.seq * 10;
|
|
9
|
+
return e.active.add(t), t;
|
|
10
|
+
}
|
|
11
|
+
function n(e) {
|
|
12
|
+
const t = a();
|
|
13
|
+
t.active.delete(e), t.active.size === 0 && (t.seq = 0);
|
|
14
|
+
}
|
|
15
|
+
function r() {
|
|
16
|
+
const e = a();
|
|
17
|
+
return e.active.size === 0 ? 1e3 : Math.max(...e.active);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
c as a,
|
|
21
|
+
r as p,
|
|
22
|
+
n as r
|
|
23
|
+
};
|
package/dist/tokens.css
CHANGED
|
@@ -28,6 +28,11 @@
|
|
|
28
28
|
/* отступ каркаса; 0 — на всю ширину вьюпорта */
|
|
29
29
|
--layout-padding: 0;
|
|
30
30
|
--layout-margin: 0;
|
|
31
|
+
--layout-gap: 0;
|
|
32
|
+
--layout-main-radius: 0;
|
|
33
|
+
--layout-main-background: transparent;
|
|
34
|
+
--layout-main-shadow: none;
|
|
35
|
+
--layout-main-border: none;
|
|
31
36
|
/* none — без ограничения; иначе например 1440px */
|
|
32
37
|
--layout-max-width: none;
|
|
33
38
|
|
|
@@ -76,6 +81,21 @@
|
|
|
76
81
|
--stat-value-size: 1.75rem;
|
|
77
82
|
--action-group-gap: var(--shell-gap-sm);
|
|
78
83
|
|
|
84
|
+
/* —— panel-info —— */
|
|
85
|
+
--panel-info-width: min(22rem, 42vw);
|
|
86
|
+
--panel-info-width-min: 16rem;
|
|
87
|
+
--panel-info-overlay-max: 24rem;
|
|
88
|
+
--panel-info-backdrop: color-mix(in srgb, var(--shell-color) 35%, transparent);
|
|
89
|
+
|
|
90
|
+
/* —— healthmap —— */
|
|
91
|
+
--healthmap-cell: 12px;
|
|
92
|
+
--healthmap-gap: 3px;
|
|
93
|
+
--healthmap-l0: var(--shell-background-muted);
|
|
94
|
+
--healthmap-l1: color-mix(in srgb, var(--shell-color-success) 25%, var(--shell-background-muted));
|
|
95
|
+
--healthmap-l2: color-mix(in srgb, var(--shell-color-success) 45%, transparent);
|
|
96
|
+
--healthmap-l3: color-mix(in srgb, var(--shell-color-success) 70%, transparent);
|
|
97
|
+
--healthmap-l4: var(--shell-color-success);
|
|
98
|
+
|
|
79
99
|
/* —— item-column —— */
|
|
80
100
|
--item-column-gap: var(--shell-gap);
|
|
81
101
|
--item-column-icon-size: 40px;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elcrm/components",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Shell UI elCRM: Layout, Header, Sidebar, Popover, PageHead, PageShell, Section, Stack, Stat
|
|
3
|
+
"version": "0.2.7",
|
|
4
|
+
"description": "Shell UI elCRM: Layout, Header, Sidebar, Popover, Healthmap, PanelInfo, PageHead, PageShell, Section, Stack, Stat и др.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "MaSkal <dev@elcrm.online>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -84,18 +84,6 @@
|
|
|
84
84
|
},
|
|
85
85
|
"./package.json": "./package.json"
|
|
86
86
|
},
|
|
87
|
-
"scripts": {
|
|
88
|
-
"dev": "vite --config test/vite.config.ts",
|
|
89
|
-
"build": "vite build",
|
|
90
|
-
"postbuild": "node scripts/postbuild.mjs",
|
|
91
|
-
"check:css": "node scripts/check-css-scoped.mjs",
|
|
92
|
-
"check:tokens": "node scripts/check-tokens.mjs",
|
|
93
|
-
"test": "vitest run",
|
|
94
|
-
"test:build": "vite build --config test/vite.config.ts",
|
|
95
|
-
"test:preview": "vite preview --config test/vite.config.ts",
|
|
96
|
-
"prepublishOnly": "npm run check:css && npm run check:tokens && npm run test && npm run build",
|
|
97
|
-
"pack:check": "npm pack --dry-run"
|
|
98
|
-
},
|
|
99
87
|
"peerDependencies": {
|
|
100
88
|
"@types/react": ">=18.0.0",
|
|
101
89
|
"react": ">=18.0.0",
|
|
@@ -105,22 +93,5 @@
|
|
|
105
93
|
"@types/react": {
|
|
106
94
|
"optional": true
|
|
107
95
|
}
|
|
108
|
-
},
|
|
109
|
-
"devDependencies": {
|
|
110
|
-
"@elcrm/storybook": "file:../elCRM.storybook",
|
|
111
|
-
"@testing-library/react": "^16.2.0",
|
|
112
|
-
"@types/node": "^22.13.10",
|
|
113
|
-
"@types/react": "^18.2.66",
|
|
114
|
-
"@types/react-dom": "^18.2.22",
|
|
115
|
-
"@vitejs/plugin-react": "^4.3.1",
|
|
116
|
-
"elcrm": "file:../elCRM.cli",
|
|
117
|
-
"jsdom": "^26.0.0",
|
|
118
|
-
"react": "^18.2.0",
|
|
119
|
-
"react-dom": "^18.2.0",
|
|
120
|
-
"typescript": "^5.8.2",
|
|
121
|
-
"vite": "^5.4.2",
|
|
122
|
-
"vite-plugin-dts": "^4.0.3",
|
|
123
|
-
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
124
|
-
"vitest": "^3.0.8"
|
|
125
96
|
}
|
|
126
97
|
}
|
package/dist/Popover-D5RymtcJ.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import u, { useRef as E, useId as $, useState as T, useLayoutEffect as A, useEffect as B } from "react";
|
|
2
|
-
import { createPortal as ee } from "react-dom";
|
|
3
|
-
import { c as F } from "./cx-CcykAxZN.js";
|
|
4
|
-
import { u as te } from "./useControllableValue-CWqH1kpM.js";
|
|
5
|
-
import './Popover.css';const V = 1e3, ne = 10;
|
|
6
|
-
function b() {
|
|
7
|
-
const e = globalThis;
|
|
8
|
-
return e.elcrm || (e.elcrm = {}), e.elcrm.overlayZ || (e.elcrm.overlayZ = { seq: 0, active: /* @__PURE__ */ new Set() }), e.elcrm.overlayZ;
|
|
9
|
-
}
|
|
10
|
-
function oe() {
|
|
11
|
-
const e = b();
|
|
12
|
-
e.seq += 1;
|
|
13
|
-
const t = V + e.seq * ne;
|
|
14
|
-
return e.active.add(t), t;
|
|
15
|
-
}
|
|
16
|
-
function N(e) {
|
|
17
|
-
const t = b();
|
|
18
|
-
t.active.delete(e), t.active.size === 0 && (t.seq = 0);
|
|
19
|
-
}
|
|
20
|
-
function ve() {
|
|
21
|
-
const e = b();
|
|
22
|
-
return e.active.size === 0 ? V : Math.max(...e.active);
|
|
23
|
-
}
|
|
24
|
-
const se = "c3r", ie = "c3t", re = "c3p", H = {
|
|
25
|
-
r: se,
|
|
26
|
-
t: ie,
|
|
27
|
-
p: re
|
|
28
|
-
};
|
|
29
|
-
function ce(e, t) {
|
|
30
|
-
const c = (t == null ? void 0 : t.querySelector("button, a, [role='button']")) ?? (t == null ? void 0 : t.firstElementChild);
|
|
31
|
-
return (c instanceof HTMLElement ? c : t ?? e).getBoundingClientRect();
|
|
32
|
-
}
|
|
33
|
-
function ae(e, t) {
|
|
34
|
-
return e != null && e.top === t.top && e.left === t.left && e.minWidth === t.minWidth && e.maxHeight === t.maxHeight;
|
|
35
|
-
}
|
|
36
|
-
function le(e, t, c, p) {
|
|
37
|
-
if (!u.isValidElement(e)) return e;
|
|
38
|
-
const d = e.props.onClick;
|
|
39
|
-
return u.cloneElement(e, {
|
|
40
|
-
"aria-haspopup": "menu",
|
|
41
|
-
"aria-expanded": t,
|
|
42
|
-
"aria-controls": t ? c : void 0,
|
|
43
|
-
onClick: (v) => {
|
|
44
|
-
d == null || d(v), p();
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function he({
|
|
49
|
-
trigger: e,
|
|
50
|
-
children: t,
|
|
51
|
-
open: c,
|
|
52
|
-
defaultOpen: p = !1,
|
|
53
|
-
onOpenChange: d,
|
|
54
|
-
align: v = "end",
|
|
55
|
-
placement: x = "auto",
|
|
56
|
-
disabled: z = !1,
|
|
57
|
-
label: D,
|
|
58
|
-
role: K = "menu",
|
|
59
|
-
className: j,
|
|
60
|
-
panelClassName: G
|
|
61
|
-
}) {
|
|
62
|
-
const w = E(null), P = E(null), y = E(null), g = $(), [s = !1, J] = te(
|
|
63
|
-
c,
|
|
64
|
-
p,
|
|
65
|
-
d
|
|
66
|
-
), [m, W] = T(null), [a, q] = T(null), L = E(null);
|
|
67
|
-
L.current = a;
|
|
68
|
-
const M = (o) => {
|
|
69
|
-
z && o || J(o);
|
|
70
|
-
};
|
|
71
|
-
A(() => {
|
|
72
|
-
if (s) {
|
|
73
|
-
a == null && q(oe());
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
a != null && (N(a), q(null));
|
|
77
|
-
}, [s, a]), B(() => () => {
|
|
78
|
-
L.current != null && N(L.current);
|
|
79
|
-
}, []);
|
|
80
|
-
const R = () => {
|
|
81
|
-
var S;
|
|
82
|
-
const o = w.current;
|
|
83
|
-
if (!o) return;
|
|
84
|
-
const n = ce(o, P.current), i = 8, l = 8, r = ((S = y.current) == null ? void 0 : S.offsetHeight) ?? 0, f = window.innerHeight - n.bottom - i - l, U = n.top - i - l, X = r > 0 ? r : 160, I = x === "bottom" || x !== "top" && f >= X, Y = Math.min(
|
|
85
|
-
420,
|
|
86
|
-
Math.max(120, I ? f : U)
|
|
87
|
-
), h = Math.max(200, n.width), _ = v === "end" ? Math.max(8, Math.min(n.right - h, window.innerWidth - h - 8)) : Math.max(8, Math.min(n.left, window.innerWidth - h - 8)), O = { top: I ? n.bottom + i : Math.max(l, n.top - i - (r > 0 ? r : 0)), left: _, minWidth: h, maxHeight: Y };
|
|
88
|
-
W((C) => ae(C, O) ? C : O);
|
|
89
|
-
};
|
|
90
|
-
A(() => {
|
|
91
|
-
if (!s) {
|
|
92
|
-
W(null);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
R();
|
|
96
|
-
const o = window.requestAnimationFrame(() => R()), n = () => R();
|
|
97
|
-
return window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), () => {
|
|
98
|
-
window.cancelAnimationFrame(o), window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
|
|
99
|
-
};
|
|
100
|
-
}, [s, v, x, t]), B(() => {
|
|
101
|
-
if (!s) return;
|
|
102
|
-
const o = (i) => {
|
|
103
|
-
var r, f;
|
|
104
|
-
const l = i.target;
|
|
105
|
-
(r = w.current) != null && r.contains(l) || (f = y.current) != null && f.contains(l) || M(!1);
|
|
106
|
-
}, n = (i) => {
|
|
107
|
-
i.key === "Escape" && M(!1);
|
|
108
|
-
};
|
|
109
|
-
return document.addEventListener("mousedown", o), document.addEventListener("keydown", n), () => {
|
|
110
|
-
document.removeEventListener("mousedown", o), document.removeEventListener("keydown", n);
|
|
111
|
-
};
|
|
112
|
-
}, [s]);
|
|
113
|
-
const Q = {
|
|
114
|
-
position: "fixed",
|
|
115
|
-
zIndex: a ?? 1e3,
|
|
116
|
-
...m ? {
|
|
117
|
-
top: m.top,
|
|
118
|
-
bottom: "auto",
|
|
119
|
-
left: m.left,
|
|
120
|
-
minWidth: m.minWidth,
|
|
121
|
-
maxHeight: m.maxHeight
|
|
122
|
-
} : { visibility: "hidden", pointerEvents: "none" }
|
|
123
|
-
}, Z = s ? /* @__PURE__ */ u.createElement(
|
|
124
|
-
"div",
|
|
125
|
-
{
|
|
126
|
-
ref: y,
|
|
127
|
-
id: g,
|
|
128
|
-
role: K,
|
|
129
|
-
"aria-label": D,
|
|
130
|
-
className: F(H.p, G),
|
|
131
|
-
style: Q,
|
|
132
|
-
onMouseDown: (o) => o.stopPropagation()
|
|
133
|
-
},
|
|
134
|
-
t
|
|
135
|
-
) : null, k = () => {
|
|
136
|
-
z || M(!s);
|
|
137
|
-
};
|
|
138
|
-
return /* @__PURE__ */ u.createElement("div", { ref: w, className: F(H.r, j) }, /* @__PURE__ */ u.createElement(
|
|
139
|
-
"div",
|
|
140
|
-
{
|
|
141
|
-
ref: P,
|
|
142
|
-
className: H.t,
|
|
143
|
-
"aria-haspopup": "menu",
|
|
144
|
-
"aria-expanded": s,
|
|
145
|
-
"aria-controls": s ? g : void 0,
|
|
146
|
-
onClick: u.isValidElement(e) ? void 0 : k
|
|
147
|
-
},
|
|
148
|
-
le(e, s, g, k)
|
|
149
|
-
), Z && typeof document < "u" ? ee(Z, document.body) : null);
|
|
150
|
-
}
|
|
151
|
-
export {
|
|
152
|
-
he as P,
|
|
153
|
-
oe as a,
|
|
154
|
-
ve as p,
|
|
155
|
-
N as r
|
|
156
|
-
};
|