@elcrm/components 0.1.0 → 0.1.2
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 +66 -16
- package/dist/ActionGroup-ChKFW0mt.js +27 -0
- package/dist/ActionGroup.css +1 -0
- package/dist/ActionGroup.d.ts +42 -0
- package/dist/ActionGroup.js +4 -0
- package/dist/Avatar-loGgFt72.js +113 -0
- package/dist/Avatar.css +1 -1
- package/dist/Avatar.d.ts +9 -1
- package/dist/Avatar.js +3 -2
- package/dist/{AvatarGroup-DUe7-T3B.js → AvatarGroup-D1gnT3Od.js} +1 -1
- package/dist/AvatarGroup.js +1 -1
- package/dist/AvatarName-C1sIDPH-.js +66 -0
- package/dist/AvatarName.css +1 -1
- package/dist/AvatarName.d.ts +4 -1
- package/dist/AvatarName.js +1 -1
- package/dist/Badge-jp-9iNNL.js +28 -0
- package/dist/Badge.css +1 -1
- package/dist/Badge.d.ts +32 -17
- package/dist/Badge.js +1 -1
- package/dist/{Block-BAXh0PPp.js → Block-Bu7NEA0g.js} +1 -1
- package/dist/Block.js +1 -1
- package/dist/{Breadcrumb-D0wXkE38.js → Breadcrumb-CAM_e9LN.js} +3 -3
- package/dist/Breadcrumb.css +1 -1
- package/dist/Breadcrumb.js +1 -1
- package/dist/Card.css +1 -1
- package/dist/Card.d.ts +8 -1
- package/dist/{Column-DDaqX-A7.js → Column-BiogBDf8.js} +1 -1
- package/dist/Column.js +1 -1
- package/dist/Dropdown-CQBMF9aR.js +151 -0
- package/dist/Dropdown.css +1 -1
- package/dist/Dropdown.d.ts +3 -3
- package/dist/Dropdown.js +1 -1
- package/dist/Item-D4okhsfW.js +46 -0
- package/dist/Item.css +1 -1
- package/dist/Item.d.ts +8 -1
- package/dist/Item.js +1 -1
- package/dist/ItemColumn-M7a9L8CI.js +41 -0
- package/dist/ItemColumn.css +1 -0
- package/dist/ItemColumn.d.ts +61 -0
- package/dist/ItemColumn.js +4 -0
- package/dist/Layout-BQwEaeO0.js +22 -0
- package/dist/Layout.css +1 -1
- package/dist/Layout.d.ts +10 -5
- package/dist/Layout.js +1 -1
- package/dist/Menu-DpUvOl8Y.js +58 -0
- package/dist/Menu.css +1 -1
- package/dist/Menu.d.ts +15 -3
- package/dist/Menu.js +1 -1
- package/dist/PageHead-DgaJ1mXY.js +31 -0
- package/dist/PageHead.css +1 -1
- package/dist/PageHead.d.ts +28 -6
- package/dist/PageHead.js +1 -1
- package/dist/{PageShell-CghThHS3.js → PageShell-D9EZiO8o.js} +13 -11
- package/dist/PageShell.css +1 -1
- package/dist/PageShell.d.ts +11 -6
- package/dist/PageShell.js +1 -1
- package/dist/Popover-g2xTGubK.js +123 -0
- package/dist/Popover.css +1 -0
- package/dist/Popover.d.ts +54 -0
- package/dist/Popover.js +4 -0
- package/dist/PricingGroup-DgcdVSq8.js +126 -0
- package/dist/PricingGroup.css +1 -1
- package/dist/PricingGroup.js +1 -1
- package/dist/{PricingTable-DYTJG4AU.js → PricingTable-DALddSwM.js} +11 -11
- package/dist/PricingTable.css +1 -1
- package/dist/PricingTable.js +1 -1
- package/dist/{RadioGroup-DxoPHPIF.js → RadioGroup-D2UUOTkY.js} +25 -25
- package/dist/RadioGroup.css +1 -1
- package/dist/RadioGroup.js +1 -1
- package/dist/{Row--HIe6vb9.js → Row-DsQOVn18.js} +1 -1
- package/dist/Row.js +1 -1
- package/dist/Sidebar-DeqxYgxn.js +69 -0
- package/dist/Sidebar.css +1 -0
- package/dist/Sidebar.d.ts +83 -0
- package/dist/Sidebar.js +4 -0
- package/dist/Stack-XkmPSswj.js +53 -0
- package/dist/Stack.css +1 -1
- package/dist/Stack.d.ts +16 -4
- package/dist/Stack.js +3 -2
- package/dist/Stat-C5iZyEoo.js +27 -0
- package/dist/Stat.css +1 -0
- package/dist/Stat.d.ts +39 -0
- package/dist/Stat.js +4 -0
- package/dist/{TabSections-DL7DufKU.js → TabSections-Bf_sZo7b.js} +1 -1
- package/dist/TabSections.js +1 -1
- package/dist/TextGroup-DmhuyMR1.js +23 -0
- package/dist/TextGroup.css +1 -0
- package/dist/TextGroup.d.ts +35 -0
- package/dist/TextGroup.js +4 -0
- package/dist/dark.css +10 -0
- package/dist/index.css +27 -15
- package/dist/index.d.ts +17 -3
- package/dist/index.es.d.ts +73 -0
- package/dist/index.es.js +76 -59
- package/dist/light.css +10 -0
- package/dist/overlayZ.d.ts +9 -0
- package/dist/tokens.css +19 -0
- package/package.json +2 -2
- package/dist/Avatar-Jzan87XD.js +0 -101
- package/dist/AvatarName-KBbQrVta.js +0 -56
- package/dist/Badge-l6nUkl-H.js +0 -22
- package/dist/Dropdown-Cw5LKpcT.js +0 -168
- package/dist/Item-CaU4RW2G.js +0 -38
- package/dist/Layout-Xb3-xsmA.js +0 -18
- package/dist/Menu-DRBHvSdJ.js +0 -40
- package/dist/PageHead-Baz9BLuA.js +0 -22
- package/dist/PricingGroup-CiqQtzjd.js +0 -126
- package/dist/Stack-b0-XWwQ1.js +0 -31
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import l from "react";
|
|
2
2
|
import { c as z } from "./cx-CcykAxZN.js";
|
|
3
|
-
import './PricingTable.css';const B = "cxr", C = "cxh", M = "cxm", O = "cxn", T = "cxt", I = "cxg", L = "cxp", S = "cxz", j = "cxo", H = "cxe", K = "cxd", R = "cxx", U = "cxb", W = "cxy", $ = "cxl", A = "cxw", G = "cxc", J = "cxk", Q = "
|
|
3
|
+
import './PricingTable.css';const B = "cxr", C = "cxh", M = "cxm", O = "cxn", T = "cxt", I = "cxg", L = "cxp", S = "cxz", j = "cxo", H = "cxe", K = "cxd", R = "cxx", U = "cxb", W = "cxy", $ = "cxl", A = "cxw", G = "cxc", J = "cxk", Q = "cxv", X = "cxa", Y = "cxu", Z = "cxq", n = {
|
|
4
4
|
r: B,
|
|
5
5
|
h: C,
|
|
6
6
|
m: M,
|
|
@@ -19,13 +19,13 @@ import './PricingTable.css';const B = "cxr", C = "cxh", M = "cxm", O = "cxn", T
|
|
|
19
19
|
w: A,
|
|
20
20
|
c: G,
|
|
21
21
|
k: J,
|
|
22
|
-
|
|
22
|
+
v: Q,
|
|
23
23
|
a: X,
|
|
24
|
-
|
|
24
|
+
u: Y,
|
|
25
25
|
q: Z
|
|
26
26
|
};
|
|
27
27
|
function _() {
|
|
28
|
-
return /* @__PURE__ */ l.createElement("span", { className: n.k, "aria-hidden": !0 }, /* @__PURE__ */ l.createElement("svg", { className: n.
|
|
28
|
+
return /* @__PURE__ */ l.createElement("span", { className: n.k, "aria-hidden": !0 }, /* @__PURE__ */ l.createElement("svg", { className: n.v, viewBox: "0 0 12 12" }, /* @__PURE__ */ l.createElement(
|
|
29
29
|
"path",
|
|
30
30
|
{
|
|
31
31
|
d: "M2.5 6.2 4.8 8.5 9.5 3.5",
|
|
@@ -64,7 +64,7 @@ function ee({
|
|
|
64
64
|
},
|
|
65
65
|
m ? /* @__PURE__ */ l.createElement("span", { className: n.g }, e.badge) : null,
|
|
66
66
|
e.icon != null ? /* @__PURE__ */ l.createElement("div", { className: n.m }, e.icon) : null,
|
|
67
|
-
e.priceFirst ? /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(
|
|
67
|
+
e.priceFirst ? /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(N, { item: e }), /* @__PURE__ */ l.createElement(x, { item: e, pill: i }), e.description != null ? /* @__PURE__ */ l.createElement("p", { className: n.d }, e.description) : null) : /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(x, { item: e, pill: i }), e.descriptionPlacement === "before-price" && e.description != null ? /* @__PURE__ */ l.createElement("p", { className: n.d }, e.description) : null, /* @__PURE__ */ l.createElement(N, { item: e }), e.descriptionPlacement !== "before-price" && e.description != null ? /* @__PURE__ */ l.createElement("p", { className: n.d }, e.description) : null),
|
|
68
68
|
e.actions != null ? /* @__PURE__ */ l.createElement(
|
|
69
69
|
"div",
|
|
70
70
|
{
|
|
@@ -82,7 +82,7 @@ function x({
|
|
|
82
82
|
}) {
|
|
83
83
|
return e.title == null && !r ? null : /* @__PURE__ */ l.createElement("div", { className: n.n }, e.title != null ? /* @__PURE__ */ l.createElement("h3", { className: n.t }, e.title) : null, r ? /* @__PURE__ */ l.createElement("span", { className: n.g }, e.badge) : null);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function N({ item: e }) {
|
|
86
86
|
return e.price == null && e.priceOld == null && e.meta == null ? null : /* @__PURE__ */ l.createElement("div", { className: n.p }, e.priceOld != null ? /* @__PURE__ */ l.createElement("span", { className: n.o }, e.priceOld) : null, e.price != null ? /* @__PURE__ */ l.createElement("span", { className: n.z }, e.price) : null, e.meta != null ? /* @__PURE__ */ l.createElement("span", { className: n.e }, e.meta) : null);
|
|
87
87
|
}
|
|
88
88
|
function te({
|
|
@@ -94,18 +94,18 @@ function te({
|
|
|
94
94
|
selectable: i = !1,
|
|
95
95
|
disabled: m = !1,
|
|
96
96
|
onValueChange: a,
|
|
97
|
-
className:
|
|
97
|
+
className: f,
|
|
98
98
|
style: g,
|
|
99
99
|
...h
|
|
100
100
|
}) {
|
|
101
|
-
const [
|
|
102
|
-
p ||
|
|
101
|
+
const [b, k] = l.useState(d), p = u !== void 0, y = p ? u : b, w = (t) => {
|
|
102
|
+
p || k(t), a == null || a(t);
|
|
103
103
|
}, P = e.length, D = {
|
|
104
104
|
...g,
|
|
105
105
|
gridTemplateColumns: `var(--pricing-table-label-width) repeat(${P}, minmax(12rem, 1fr))`
|
|
106
106
|
};
|
|
107
107
|
let F = 0;
|
|
108
|
-
return /* @__PURE__ */ l.createElement("div", { className: z(n.r,
|
|
108
|
+
return /* @__PURE__ */ l.createElement("div", { className: z(n.r, f), style: D, role: "table", ...h }, /* @__PURE__ */ l.createElement("div", { className: n.q, role: "columnheader" }), e.map((t) => {
|
|
109
109
|
const s = y === t.value, c = !!t.highlighted || s;
|
|
110
110
|
return /* @__PURE__ */ l.createElement(
|
|
111
111
|
ee,
|
|
@@ -143,7 +143,7 @@ function te({
|
|
|
143
143
|
return /* @__PURE__ */ l.createElement("div", { key: E.value, className: n.c, role: "cell" }, /* @__PURE__ */ l.createElement(V, { value: (v = c.values) == null ? void 0 : v[E.value] }));
|
|
144
144
|
})
|
|
145
145
|
);
|
|
146
|
-
}))), o ? /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement("div", { className: n.q }), e.map((t) => /* @__PURE__ */ l.createElement("div", { key: t.value, className: n.
|
|
146
|
+
}))), o ? /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement("div", { className: n.q }), e.map((t) => /* @__PURE__ */ l.createElement("div", { key: t.value, className: n.u }, t.actions != null ? /* @__PURE__ */ l.createElement(
|
|
147
147
|
"div",
|
|
148
148
|
{
|
|
149
149
|
className: n.x,
|
package/dist/PricingTable.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer elcrm-components{.cxr{display:grid;width:100%;column-gap:var(--shell-gap);row-gap:0;align-items:stretch;overflow-x:auto}.cxh{display:flex;flex-direction:column;gap:var(--shell-gap-sm);padding:var(--shell-padding);box-sizing:border-box;color:var(--shell-color);background:var(--shell-background);border:1px solid transparent;border-radius:var(--shell-radius)}.cxh[data-highlighted=true]{border-color:var(--shell-color-accent);background:var(--shell-background-selected)}.cxm{display:flex;align-items:center;justify-content:center;width:calc(var(--shell-icon-size) * 1.4);height:calc(var(--shell-icon-size) * 1.4);color:var(--shell-color-accent);background:var(--shell-background-hover);border-radius:var(--shell-radius);overflow:hidden}.cxn{display:flex;flex-wrap:wrap;align-items:center;gap:var(--shell-gap-sm)}.cxt{margin:0;font-size:var(--shell-font-size);font-weight:var(--shell-font-weight);color:var(--shell-color);line-height:1.3}.cxg{display:inline-flex;align-items:center;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)}.cxp{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--shell-gap-sm)}.cxz{font-size:var(--shell-font-size-lg);font-weight:700;color:var(--shell-color);line-height:1.15}.cxo{font-size:var(--shell-font-size-sm);color:var(--shell-color-muted);text-decoration:line-through}.cxe{font-size:var(--shell-font-size-sm);color:var(--shell-color-muted)}.cxd{margin:0;font-size:var(--shell-font-size-sm);color:var(--shell-color-muted);line-height:1.45}.cxx{display:flex;flex-direction:column;gap:var(--shell-gap-sm)}.cxb{grid-column:1 / -1;margin:var(--shell-gap) 0 var(--shell-gap-sm);padding:0;font-size:var(--shell-font-size-sm);font-weight:var(--shell-font-weight);color:var(--shell-color-accent)}.cxf,.cxy{display:contents}.cxy>*{padding:var(--shell-padding);box-sizing:border-box;border-bottom:1px solid var(--shell-border);background:var(--shell-background)}.cxy[data-alt=true]>*{background:var(--shell-background-muted)}.cxl{display:flex;align-items:center;gap:var(--shell-gap-sm);font-size:var(--shell-font-size-sm);color:var(--shell-color);line-height:1.4}.cxw{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--shell-status-size);height:var(--shell-status-size);padding:0;border:1px solid var(--shell-border);border-radius:50%;background:transparent;color:var(--shell-color-muted);font-size:9px;line-height:1;cursor:help}.cxc{display:flex;align-items:center;justify-content:center;text-align:center;font-size:var(--shell-font-size-sm);color:var(--shell-color);font-weight:500}.cxk{display:inline-flex;align-items:center;justify-content:center;width:var(--shell-check-size);height:var(--shell-check-size);color:#fff;background:var(--shell-color-success);border-radius:50%}.
|
|
1
|
+
@layer elcrm-components{.cxr{display:grid;width:100%;column-gap:var(--shell-gap);row-gap:0;align-items:stretch;overflow-x:auto}.cxh{display:flex;flex-direction:column;gap:var(--shell-gap-sm);padding:var(--shell-padding);box-sizing:border-box;color:var(--shell-color);background:var(--shell-background);border:1px solid transparent;border-radius:var(--shell-radius)}.cxh[data-highlighted=true]{border-color:var(--shell-color-accent);background:var(--shell-background-selected)}.cxm{display:flex;align-items:center;justify-content:center;width:calc(var(--shell-icon-size) * 1.4);height:calc(var(--shell-icon-size) * 1.4);color:var(--shell-color-accent);background:var(--shell-background-hover);border-radius:var(--shell-radius);overflow:hidden}.cxn{display:flex;flex-wrap:wrap;align-items:center;gap:var(--shell-gap-sm)}.cxt{margin:0;font-size:var(--shell-font-size);font-weight:var(--shell-font-weight);color:var(--shell-color);line-height:1.3}.cxg{display:inline-flex;align-items:center;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)}.cxp{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--shell-gap-sm)}.cxz{font-size:var(--shell-font-size-lg);font-weight:700;color:var(--shell-color);line-height:1.15}.cxo{font-size:var(--shell-font-size-sm);color:var(--shell-color-muted);text-decoration:line-through}.cxe{font-size:var(--shell-font-size-sm);color:var(--shell-color-muted)}.cxd{margin:0;font-size:var(--shell-font-size-sm);color:var(--shell-color-muted);line-height:1.45}.cxx{display:flex;flex-direction:column;gap:var(--shell-gap-sm)}.cxb{grid-column:1 / -1;margin:var(--shell-gap) 0 var(--shell-gap-sm);padding:0;font-size:var(--shell-font-size-sm);font-weight:var(--shell-font-weight);color:var(--shell-color-accent)}.cxf,.cxy{display:contents}.cxy>*{padding:var(--shell-padding);box-sizing:border-box;border-bottom:1px solid var(--shell-border);background:var(--shell-background)}.cxy[data-alt=true]>*{background:var(--shell-background-muted)}.cxl{display:flex;align-items:center;gap:var(--shell-gap-sm);font-size:var(--shell-font-size-sm);color:var(--shell-color);line-height:1.4}.cxw{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--shell-status-size);height:var(--shell-status-size);padding:0;border:1px solid var(--shell-border);border-radius:50%;background:transparent;color:var(--shell-color-muted);font-size:9px;line-height:1;cursor:help}.cxc{display:flex;align-items:center;justify-content:center;text-align:center;font-size:var(--shell-font-size-sm);color:var(--shell-color);font-weight:500}.cxk{display:inline-flex;align-items:center;justify-content:center;width:var(--shell-check-size);height:var(--shell-check-size);color:#fff;background:var(--shell-color-success);border-radius:50%}.cxv{width:60%;height:60%;display:block}.cxa{color:var(--shell-color-muted)}.cxu{display:flex;flex-direction:column;gap:var(--shell-gap-sm);padding:var(--shell-padding);box-sizing:border-box}.cxq{min-width:var(--pricing-table-label-width)}}
|
package/dist/PricingTable.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import e from "react";
|
|
2
2
|
import { c as r } from "./cx-CcykAxZN.js";
|
|
3
|
-
import './RadioGroup.css';const
|
|
4
|
-
r:
|
|
5
|
-
i:
|
|
6
|
-
s:
|
|
7
|
-
p:
|
|
3
|
+
import './RadioGroup.css';const D = "cqr", F = "cqi", L = "cqs", M = "cqp", B = "cqh", I = "cqn", j = "cqm", A = "cqf", G = "cqc", S = "cqt", T = "cqe", U = "cqd", W = "cqx", $ = "cqy", C = "cqz", H = "cqk", J = "cqo", K = "cqq", O = "cqw", c = {
|
|
4
|
+
r: D,
|
|
5
|
+
i: F,
|
|
6
|
+
s: L,
|
|
7
|
+
p: M,
|
|
8
8
|
h: B,
|
|
9
9
|
n: I,
|
|
10
10
|
m: j,
|
|
11
|
-
|
|
11
|
+
f: A,
|
|
12
12
|
c: G,
|
|
13
13
|
t: S,
|
|
14
14
|
e: T,
|
|
@@ -17,12 +17,12 @@ import './RadioGroup.css';const F = "cqr", L = "cqi", M = "cqs", w = "cqp", B =
|
|
|
17
17
|
y: $,
|
|
18
18
|
z: C,
|
|
19
19
|
k: H,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
o: J,
|
|
21
|
+
q: K,
|
|
22
|
+
w: O
|
|
23
23
|
};
|
|
24
24
|
function P() {
|
|
25
|
-
return /* @__PURE__ */ e.createElement("svg", { className: c.
|
|
25
|
+
return /* @__PURE__ */ e.createElement("svg", { className: c.w, viewBox: "0 0 12 12", "aria-hidden": !0 }, /* @__PURE__ */ e.createElement(
|
|
26
26
|
"path",
|
|
27
27
|
{
|
|
28
28
|
d: "M2.5 6.2 4.8 8.5 9.5 3.5",
|
|
@@ -34,7 +34,7 @@ function P() {
|
|
|
34
34
|
}
|
|
35
35
|
));
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function v({
|
|
38
38
|
kind: t,
|
|
39
39
|
selected: l
|
|
40
40
|
}) {
|
|
@@ -42,7 +42,7 @@ function E({
|
|
|
42
42
|
return /* @__PURE__ */ e.createElement(
|
|
43
43
|
"span",
|
|
44
44
|
{
|
|
45
|
-
className: r(c.k, a ? c.
|
|
45
|
+
className: r(c.k, a ? c.o : c.q),
|
|
46
46
|
"data-on": l ? "true" : void 0,
|
|
47
47
|
"aria-hidden": !0
|
|
48
48
|
},
|
|
@@ -75,52 +75,52 @@ function Y({
|
|
|
75
75
|
name: s,
|
|
76
76
|
disabled: m = !1,
|
|
77
77
|
indicator: p = "check",
|
|
78
|
-
indicatorSide:
|
|
78
|
+
indicatorSide: N = "end",
|
|
79
79
|
onValueChange: u,
|
|
80
|
-
className:
|
|
80
|
+
className: k,
|
|
81
81
|
...h
|
|
82
82
|
}) {
|
|
83
|
-
const b = e.useId(),
|
|
84
|
-
|
|
83
|
+
const b = e.useId(), w = s ?? b, [x, y] = e.useState(a), E = l !== void 0, g = E ? l : x, z = (n) => {
|
|
84
|
+
E || y(n), u == null || u(n);
|
|
85
85
|
};
|
|
86
86
|
return /* @__PURE__ */ e.createElement(
|
|
87
87
|
"div",
|
|
88
88
|
{
|
|
89
|
-
className: r(c.r,
|
|
89
|
+
className: r(c.r, k),
|
|
90
90
|
role: "radiogroup",
|
|
91
91
|
"aria-disabled": m || void 0,
|
|
92
92
|
...h
|
|
93
93
|
},
|
|
94
94
|
t.map((n) => {
|
|
95
|
-
const o =
|
|
95
|
+
const o = g === n.value, R = m || !!n.disabled, d = n.variant === "split", q = n.iconFramed !== !1;
|
|
96
96
|
return /* @__PURE__ */ e.createElement(
|
|
97
97
|
"label",
|
|
98
98
|
{
|
|
99
99
|
key: n.value,
|
|
100
100
|
className: r(c.i, o && c.s, d && c.p),
|
|
101
101
|
"data-selected": o ? "true" : void 0,
|
|
102
|
-
"data-indicator": d ? void 0 :
|
|
102
|
+
"data-indicator": d ? void 0 : N
|
|
103
103
|
},
|
|
104
104
|
/* @__PURE__ */ e.createElement(
|
|
105
105
|
"input",
|
|
106
106
|
{
|
|
107
107
|
className: c.n,
|
|
108
108
|
type: "radio",
|
|
109
|
-
name:
|
|
109
|
+
name: w,
|
|
110
110
|
value: n.value,
|
|
111
111
|
checked: o,
|
|
112
|
-
disabled:
|
|
113
|
-
onChange: () =>
|
|
112
|
+
disabled: R,
|
|
113
|
+
onChange: () => z(n.value)
|
|
114
114
|
}
|
|
115
115
|
),
|
|
116
|
-
d ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: c.h }, n.icon != null ? /* @__PURE__ */ e.createElement("div", { className: r(c.m,
|
|
116
|
+
d ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: c.h }, n.icon != null ? /* @__PURE__ */ e.createElement("div", { className: r(c.m, q && c.f) }, n.icon) : null, /* @__PURE__ */ e.createElement(i, { title: n.title }), /* @__PURE__ */ e.createElement(v, { kind: p, selected: o })), /* @__PURE__ */ e.createElement("div", { className: c.y }, /* @__PURE__ */ e.createElement(
|
|
117
117
|
i,
|
|
118
118
|
{
|
|
119
119
|
price: n.price,
|
|
120
120
|
meta: n.meta,
|
|
121
121
|
badge: n.badge
|
|
122
122
|
}
|
|
123
|
-
), n.description != null ? /* @__PURE__ */ e.createElement("p", { className: c.d }, n.description) : null, n.actions != null ? /* @__PURE__ */ e.createElement(f, null, n.actions) : null)) : /* @__PURE__ */ e.createElement(e.Fragment, null, n.icon != null ? /* @__PURE__ */ e.createElement("div", { className: r(c.m,
|
|
123
|
+
), n.description != null ? /* @__PURE__ */ e.createElement("p", { className: c.d }, n.description) : null, n.actions != null ? /* @__PURE__ */ e.createElement(f, null, n.actions) : null)) : /* @__PURE__ */ e.createElement(e.Fragment, null, n.icon != null ? /* @__PURE__ */ e.createElement("div", { className: r(c.m, q && c.f) }, n.icon) : null, /* @__PURE__ */ e.createElement("div", { className: c.c }, /* @__PURE__ */ e.createElement(
|
|
124
124
|
i,
|
|
125
125
|
{
|
|
126
126
|
title: n.title,
|
|
@@ -128,7 +128,7 @@ function Y({
|
|
|
128
128
|
price: n.price,
|
|
129
129
|
badge: n.badge
|
|
130
130
|
}
|
|
131
|
-
), n.description != null ? /* @__PURE__ */ e.createElement("p", { className: c.d }, n.description) : null, n.actions != null ? /* @__PURE__ */ e.createElement(f, null, n.actions) : null), /* @__PURE__ */ e.createElement(
|
|
131
|
+
), n.description != null ? /* @__PURE__ */ e.createElement("p", { className: c.d }, n.description) : null, n.actions != null ? /* @__PURE__ */ e.createElement(f, null, n.actions) : null), /* @__PURE__ */ e.createElement(v, { kind: p, selected: o }))
|
|
132
132
|
);
|
|
133
133
|
})
|
|
134
134
|
);
|
package/dist/RadioGroup.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer elcrm-components{.cqr{display:flex;flex-direction:column;gap:var(--shell-gap)}.cqi{display:flex;align-items:flex-start;gap:var(--shell-gap);width:100%;margin:0;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);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.cqi:hover:not(:disabled){background:var(--shell-background-hover)}.cqi:disabled{opacity:var(--shell-disabled-opacity);cursor:not-allowed}.cqs,.cqi[data-selected=true]{border-color:var(--shell-color-accent);background:var(--shell-background-selected)}.cqp{flex-direction:column;align-items:stretch;padding:0;gap:0}.cqp.cqs .cqh,.cqp[data-selected=true] .cqh{border-bottom-color:var(--shell-color-accent)}.cqn{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.cqm{display:flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden}.
|
|
1
|
+
@layer elcrm-components{.cqr{display:flex;flex-direction:column;gap:var(--shell-gap)}.cqi{display:flex;align-items:flex-start;gap:var(--shell-gap);width:100%;margin:0;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);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.cqi:hover:not(:disabled){background:var(--shell-background-hover)}.cqi:disabled{opacity:var(--shell-disabled-opacity);cursor:not-allowed}.cqs,.cqi[data-selected=true]{border-color:var(--shell-color-accent);background:var(--shell-background-selected)}.cqp{flex-direction:column;align-items:stretch;padding:0;gap:0}.cqp.cqs .cqh,.cqp[data-selected=true] .cqh{border-bottom-color:var(--shell-color-accent)}.cqn{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.cqm{display:flex;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden}.cqf{width:var(--shell-icon-size);height:var(--shell-icon-size);padding:var(--shell-gap-sm);box-sizing:content-box;color:var(--shell-color-muted);background:var(--shell-background-muted);border:1px solid var(--shell-border);border-radius:var(--shell-radius)}.cqc{display:flex;flex:1;flex-direction:column;gap:var(--shell-gap-sm);min-width:0}.cqt{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--shell-gap-sm);font-size:var(--shell-font-size);font-weight:var(--shell-font-weight);color:var(--shell-color);line-height:1.3}.cqe{font-size:var(--shell-font-size-sm);font-weight:400;color:var(--shell-color-muted)}.cqd{margin:0;font-size:var(--shell-font-size-sm);color:var(--shell-color-muted);line-height:1.45}.cqx{display:flex;flex-wrap:wrap;gap:var(--shell-gap-sm);margin-top:var(--shell-gap-sm)}.cqh{display:flex;align-items:center;gap:var(--shell-gap);padding:var(--shell-padding);border-bottom:1px solid var(--shell-border)}.cqh .cqt{flex:1;min-width:0}.cqy{display:flex;flex-direction:column;gap:var(--shell-gap-sm);padding:var(--shell-padding)}.cqz{font-size:var(--shell-font-size-lg);font-weight:700;color:var(--shell-color);line-height:1.2}.cqk{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--shell-check-size);height:var(--shell-check-size);margin-left:auto;box-sizing:border-box;border:1px solid var(--shell-border);background:var(--shell-background);color:#fff}.cqi[data-indicator=start]>.cqk{margin-left:0;order:-1}.cqo{border-radius:50%}.cqo[data-on=true]{border-color:var(--shell-color-accent);background:var(--shell-color-accent);box-shadow:inset 0 0 0 3px var(--shell-background-selected)}.cqq{border-radius:calc(var(--shell-radius) * .4)}.cqq[data-on=true]{border-color:var(--shell-color-accent);background:var(--shell-color-accent)}.cqw{width:60%;height:60%;display:block}}
|
package/dist/RadioGroup.js
CHANGED
package/dist/Row.js
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import l from "react";
|
|
2
|
+
import { B as h } from "./Badge-jp-9iNNL.js";
|
|
3
|
+
import { I as x } from "./Item-D4okhsfW.js";
|
|
4
|
+
import { c as u } from "./cx-CcykAxZN.js";
|
|
5
|
+
import './Sidebar.css';const k = "c2r", g = "c2b", y = "c2x", B = "c2g", I = "c2s", w = "c2p", z = "c2h", C = "c2n", R = "c2i", T = "c2a", $ = "c2o", j = "c2l", q = "c2d", A = "c2f", D = "c2v", e = {
|
|
6
|
+
r: k,
|
|
7
|
+
b: g,
|
|
8
|
+
x: y,
|
|
9
|
+
g: B,
|
|
10
|
+
s: I,
|
|
11
|
+
p: w,
|
|
12
|
+
h: z,
|
|
13
|
+
n: C,
|
|
14
|
+
i: R,
|
|
15
|
+
a: T,
|
|
16
|
+
o: $,
|
|
17
|
+
l: j,
|
|
18
|
+
d: q,
|
|
19
|
+
f: A,
|
|
20
|
+
v: D
|
|
21
|
+
};
|
|
22
|
+
function F(n) {
|
|
23
|
+
if (n == null || n === "") return null;
|
|
24
|
+
const c = Number(n);
|
|
25
|
+
return !Number.isNaN(c) && c === 0 ? null : !Number.isNaN(c) && c > 99 ? "99+" : String(n);
|
|
26
|
+
}
|
|
27
|
+
function L({
|
|
28
|
+
groups: n,
|
|
29
|
+
items: c,
|
|
30
|
+
value: v,
|
|
31
|
+
onSelect: s,
|
|
32
|
+
variant: E = "cards",
|
|
33
|
+
brand: o,
|
|
34
|
+
extra: r,
|
|
35
|
+
footer: N,
|
|
36
|
+
version: m,
|
|
37
|
+
className: f,
|
|
38
|
+
"aria-label": b = "Основное меню"
|
|
39
|
+
}) {
|
|
40
|
+
const p = n ?? c ?? [];
|
|
41
|
+
return /* @__PURE__ */ l.createElement(
|
|
42
|
+
"aside",
|
|
43
|
+
{
|
|
44
|
+
className: u(e.r, E === "plain" && e.p, f),
|
|
45
|
+
"aria-label": b
|
|
46
|
+
},
|
|
47
|
+
o != null || r != null ? /* @__PURE__ */ l.createElement("div", { className: e.b }, o, r != null ? /* @__PURE__ */ l.createElement("div", { className: e.x }, r) : null) : null,
|
|
48
|
+
/* @__PURE__ */ l.createElement("div", { className: e.g }, p.map((t) => /* @__PURE__ */ l.createElement("nav", { key: t.value, className: e.s, "aria-label": t.title ?? "Навигация" }, t.title ? /* @__PURE__ */ l.createElement("div", { className: e.h }, t.title) : null, /* @__PURE__ */ l.createElement("ul", { className: e.n }, (t.items ?? []).map((a) => {
|
|
49
|
+
const d = F(a.badge), i = v === a.value;
|
|
50
|
+
return /* @__PURE__ */ l.createElement("li", { key: a.value }, /* @__PURE__ */ l.createElement(
|
|
51
|
+
x,
|
|
52
|
+
{
|
|
53
|
+
as: "button",
|
|
54
|
+
active: i,
|
|
55
|
+
className: u(e.i, i && e.a),
|
|
56
|
+
"aria-current": i ? "page" : void 0,
|
|
57
|
+
onClick: () => s == null ? void 0 : s(a.value)
|
|
58
|
+
},
|
|
59
|
+
a.icon != null ? /* @__PURE__ */ l.createElement("span", { className: e.o, "aria-hidden": !0 }, a.icon) : null,
|
|
60
|
+
/* @__PURE__ */ l.createElement("span", { className: e.l }, a.label),
|
|
61
|
+
d != null ? /* @__PURE__ */ l.createElement(h, { className: e.d, tone: "accent", size: "s" }, d) : null
|
|
62
|
+
));
|
|
63
|
+
}))))),
|
|
64
|
+
N != null || m != null ? /* @__PURE__ */ l.createElement("div", { className: u(e.s, e.f) }, N, m != null ? /* @__PURE__ */ l.createElement("div", { className: e.v }, m) : null) : null
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
L as S
|
|
69
|
+
};
|
package/dist/Sidebar.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer elcrm-components{.c2r{box-sizing:border-box;display:flex;flex-direction:column;flex:0 0 var(--sidebar-width);width:var(--sidebar-width);min-height:100svh;max-height:100svh;padding:var(--sidebar-pad-y) var(--sidebar-pad-x);gap:var(--shell-gap-sm);color:var(--shell-color);position:sticky;top:0;align-self:flex-start}.c2b{display:flex;flex-direction:row;align-items:center;gap:var(--shell-gap);padding:4px 8px;min-width:0}.c2x{flex-shrink:0;margin-left:auto}.c2g{flex:1;min-height:0;display:flex;flex-direction:column;gap:var(--shell-gap-sm);overflow-y:auto;overflow-x:hidden;scrollbar-width:thin}.c2s{box-sizing:border-box;flex-shrink:0;padding:8px}.c2p{--sidebar-plain: 1}.c2r:not(.c2p) .c2s{background:var(--sidebar-block-bg, var(--shell-background));border:1px solid var(--sidebar-block-border, var(--shell-border));border-radius:var(--sidebar-block-radius, var(--shell-radius));box-shadow:var(--sidebar-block-shadow, none)}.c2h{margin:2px 10px 6px;font-size:var(--sidebar-group-font-size, 11px);font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--shell-color-muted)}.c2n{margin:0;padding:0;list-style:none}.c2n>li{list-style:none}.c2n .c2i:is(button){position:relative;display:flex;width:100%;box-sizing:border-box;flex-direction:row;align-items:center;gap:8px;margin:0 0 1px;padding:var(--sidebar-item-padding, 6px 10px);border:0;border-radius:8px;background:transparent;color:var(--shell-color-muted);font-family:inherit;font-size:var(--sidebar-item-font-size, 13px);font-weight:500;line-height:1.25;letter-spacing:0;text-align:left;cursor:pointer}.c2n .c2i:is(button):hover{color:var(--shell-color);background:var(--shell-background-hover)}.c2n .c2i:is(button).c2a,.c2n .c2i:is(button)[aria-current=page],.c2n .c2i:is(button)[data-active=true],.c2n .c2i:is(button).c2a:hover{color:var(--sidebar-item-active, var(--shell-color));background:var(--sidebar-item-active-bg, var(--shell-background-selected))}.c2o{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--sidebar-icon-size, 16px);height:var(--sidebar-icon-size, 16px);color:inherit}.c2o :is(svg){display:block;width:var(--sidebar-icon-size, 16px);height:var(--sidebar-icon-size, 16px)}.c2a .c2o{color:var(--sidebar-icon-active, var(--shell-color-accent))}.c2l{flex:1;min-width:0}.c2d{flex-shrink:0;min-width:16px;height:16px;padding:0 4px;font-size:10px}.c2f{margin-top:auto}.c2v{margin-top:var(--shell-gap-sm);font-size:11px;color:var(--shell-color-muted);text-align:center}@media (max-width: 900px){.c2r{flex:0 0 72px;width:72px;padding:12px 8px}.c2l,.c2h,.c2v{display:none}.c2b{flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:4px 0}.c2x{margin-left:0}.c2s{padding:6px}.c2n .c2i{justify-content:center;align-items:center;gap:0;width:100%;min-height:40px;padding:10px 0}.c2n .c2d{position:absolute;top:4px;right:4px;min-width:14px;height:14px;padding:0 4px;font-size:.625rem;line-height:14px;pointer-events:none}}}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** Вид колонки: карточки (консоль) или плоский список (backoffice) */
|
|
3
|
+
export type SidebarVariant = "cards" | "plain";
|
|
4
|
+
/** Пункт бокового меню. Идентификатор — `value`. */
|
|
5
|
+
export type SidebarItem = {
|
|
6
|
+
value: string;
|
|
7
|
+
/** Подпись */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Иконка (слот приложения) */
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
/** Счётчик справа */
|
|
12
|
+
badge?: number | string | null;
|
|
13
|
+
};
|
|
14
|
+
/** Группа пунктов. `title` — «Аккаунт» / «Админ». */
|
|
15
|
+
export type SidebarGroup = {
|
|
16
|
+
value: string;
|
|
17
|
+
title?: string;
|
|
18
|
+
items: SidebarItem[];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Левая колонка приложения: бренд, группы меню, футер.
|
|
22
|
+
*
|
|
23
|
+
* Роли: Sidebar = навигация приложения; не путать с NavSections
|
|
24
|
+
* (сайдбар внутри страницы + lazy-панель).
|
|
25
|
+
*
|
|
26
|
+
* `variant="cards"` — секции-карточки (elWMS Console).
|
|
27
|
+
* `variant="plain"` — плоский список и заголовок группы (backoffice).
|
|
28
|
+
*
|
|
29
|
+
* Иконки, колокольчик, тема, выход — слоты приложения
|
|
30
|
+
* (`brand`, `extra`, `footer`). Роутер не подключаем.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <Sidebar
|
|
35
|
+
* variant="cards"
|
|
36
|
+
* value={page}
|
|
37
|
+
* onSelect={setPage}
|
|
38
|
+
* brand={<Brand as="strong">App</Brand>}
|
|
39
|
+
* extra={<Notifications.Bell />}
|
|
40
|
+
* groups={[
|
|
41
|
+
* { value: "main", items: [{ value: "home", label: "Обзор", icon: <Icon /> }] },
|
|
42
|
+
* { value: "admin", title: "Админ", items: [{ value: "users", label: "Люди" }] },
|
|
43
|
+
* ]}
|
|
44
|
+
* footer={<AvatarName title="Паша" description="mail@…" />}
|
|
45
|
+
* version="v 0.2.26"
|
|
46
|
+
* />
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* Токены: `--sidebar-*`, цвета — `--shell-*`.
|
|
50
|
+
*/
|
|
51
|
+
export type SidebarProps = {
|
|
52
|
+
/** Группы пунктов (`value` + `items`) */
|
|
53
|
+
groups?: SidebarGroup[];
|
|
54
|
+
/** То же, что `groups` (совместимость) */
|
|
55
|
+
items?: SidebarGroup[];
|
|
56
|
+
/** Текущий пункт */
|
|
57
|
+
value?: string;
|
|
58
|
+
/** Выбор пункта */
|
|
59
|
+
onSelect?: (value: string) => void;
|
|
60
|
+
/**
|
|
61
|
+
* `cards` — блоки-карточки.
|
|
62
|
+
* `plain` — плоский список.
|
|
63
|
+
* @default "cards"
|
|
64
|
+
*/
|
|
65
|
+
variant?: SidebarVariant;
|
|
66
|
+
/** Логотип / название */
|
|
67
|
+
brand?: React.ReactNode;
|
|
68
|
+
/** Справа от бренда (колокольчик) */
|
|
69
|
+
extra?: React.ReactNode;
|
|
70
|
+
/** Низ: тема, выход или карточка пользователя */
|
|
71
|
+
footer?: React.ReactNode;
|
|
72
|
+
/** Версия под футером */
|
|
73
|
+
version?: React.ReactNode;
|
|
74
|
+
/** Подпись колонки */
|
|
75
|
+
"aria-label"?: string;
|
|
76
|
+
className?: string;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Левая навигация приложения.
|
|
80
|
+
*
|
|
81
|
+
* @see Layout, Brand, Item, Badge, NavSections
|
|
82
|
+
*/
|
|
83
|
+
export declare function Sidebar({ groups, items, value, onSelect, variant, brand, extra, footer, version, className, "aria-label": ariaLabel, }: SidebarProps): React.JSX.Element;
|
package/dist/Sidebar.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import m from "react";
|
|
2
|
+
import { c as f } from "./cx-CcykAxZN.js";
|
|
3
|
+
import './Stack.css';function l(t) {
|
|
4
|
+
if (t != null)
|
|
5
|
+
return { gap: typeof t == "number" ? `${t}px` : t };
|
|
6
|
+
}
|
|
7
|
+
const i = "c1r", p = "c1c", g = "c1g", h = "c1h", v = "c1n", r = {
|
|
8
|
+
r: i,
|
|
9
|
+
c: p,
|
|
10
|
+
g,
|
|
11
|
+
h,
|
|
12
|
+
n: v
|
|
13
|
+
};
|
|
14
|
+
function x(t) {
|
|
15
|
+
if (typeof t == "number")
|
|
16
|
+
return t <= 0 ? void 0 : `repeat(${t}, minmax(0, 1fr))`;
|
|
17
|
+
if (t.length !== 0)
|
|
18
|
+
return t.map((n) => typeof n == "number" ? `${n}px` : n).join(" ");
|
|
19
|
+
}
|
|
20
|
+
function k({
|
|
21
|
+
direction: t = "column",
|
|
22
|
+
columns: n,
|
|
23
|
+
gap: c,
|
|
24
|
+
children: o,
|
|
25
|
+
className: a,
|
|
26
|
+
style: s,
|
|
27
|
+
...u
|
|
28
|
+
}) {
|
|
29
|
+
const e = t === "grid" && n != null ? x(n) : void 0;
|
|
30
|
+
return /* @__PURE__ */ m.createElement(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: f(
|
|
34
|
+
r.r,
|
|
35
|
+
t === "column" && r.c,
|
|
36
|
+
t === "row" && r.h,
|
|
37
|
+
t === "grid" && (e ? r.n : r.g),
|
|
38
|
+
a
|
|
39
|
+
),
|
|
40
|
+
style: {
|
|
41
|
+
...l(c),
|
|
42
|
+
...e ? { "--stack-columns-template": e } : null,
|
|
43
|
+
...s
|
|
44
|
+
},
|
|
45
|
+
...u
|
|
46
|
+
},
|
|
47
|
+
o
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
k as S,
|
|
52
|
+
x as s
|
|
53
|
+
};
|
package/dist/Stack.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer elcrm-components{.c1r{
|
|
1
|
+
@layer elcrm-components{.c1r{box-sizing:border-box;min-width:0;gap:var(--shell-gap)}.c1c,.c1g{width:100%}.c1c{display:flex;flex-direction:column}.c1h{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;width:auto;max-width:100%}.c1g{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--stack-grid-min)),1fr))}.c1n{display:grid;width:100%;align-items:stretch;grid-template-columns:var(--stack-columns-template)}}
|
package/dist/Stack.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
/** Направление раскладки стека */
|
|
3
|
-
export type StackDirection = "row" | "column";
|
|
3
|
+
export type StackDirection = "row" | "column" | "grid";
|
|
4
|
+
/** Сетка: число равных колонок или треки (`1fr`, `100px`, …). Число в массиве — px. */
|
|
5
|
+
export type StackColumns = number | Array<number | string>;
|
|
6
|
+
/** CSS `grid-template-columns` из пропа `columns`. */
|
|
7
|
+
export declare function stackColumnsTemplate(columns: StackColumns): string | undefined;
|
|
4
8
|
/**
|
|
5
9
|
* Универсальный стек (ряд / колонка) с отступами между детьми.
|
|
6
10
|
*
|
|
@@ -13,13 +17,21 @@ export type StackDirection = "row" | "column";
|
|
|
13
17
|
* <Button>Отмена</Button>
|
|
14
18
|
* <Button>Сохранить</Button>
|
|
15
19
|
* </Stack>
|
|
20
|
+
* <Stack direction="grid" columns={["1fr", "100px", "100px"]} gap={12} />
|
|
16
21
|
* ```
|
|
17
22
|
*
|
|
18
|
-
* Токены: `--shell-gap` (если `gap` не задан);
|
|
23
|
+
* Токены: `--shell-gap` (если `gap` не задан); сетка — `--stack-grid-min`.
|
|
24
|
+
* `columns` — число равных колонок или массив треков (`--stack-columns-template`).
|
|
25
|
+
* Явные колонки: `align-items: stretch` (несколько рядов). Центр в одном ряду — `style={{ alignItems: "center" }}`.
|
|
19
26
|
*/
|
|
20
27
|
export type StackProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
21
|
-
/** Направление: по умолчанию `column` */
|
|
28
|
+
/** Направление: по умолчанию `column`. `grid` — сетка */
|
|
22
29
|
direction?: StackDirection;
|
|
30
|
+
/**
|
|
31
|
+
* Сетка: `4` — четыре равные колонки;
|
|
32
|
+
* `["1fr", "100px", "auto"]` — свои треки (число в массиве = px).
|
|
33
|
+
*/
|
|
34
|
+
columns?: StackColumns;
|
|
23
35
|
/** Отступ между детьми: число (px) или CSS-строка */
|
|
24
36
|
gap?: number | string;
|
|
25
37
|
/** Дочерние элементы стека */
|
|
@@ -31,4 +43,4 @@ export type StackProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
31
43
|
*
|
|
32
44
|
* @see Block, Row, Column
|
|
33
45
|
*/
|
|
34
|
-
export declare function Stack({ direction, gap, children, className, style, ...rest }: StackProps): React.JSX.Element;
|
|
46
|
+
export declare function Stack({ direction, columns, gap, children, className, style, ...rest }: StackProps): React.JSX.Element;
|
package/dist/Stack.js
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import a from "react";
|
|
2
|
+
import { C as u } from "./Card-hn37Opo3.js";
|
|
3
|
+
import { c as t } from "./cx-CcykAxZN.js";
|
|
4
|
+
import './Stat.css';const d = "c4r", p = "c4l", i = "c4le", w = "c4v", f = "c4a", v = "c4u", C = "c4w", E = "c4d", c = {
|
|
5
|
+
r: d,
|
|
6
|
+
l: p,
|
|
7
|
+
le: i,
|
|
8
|
+
v: w,
|
|
9
|
+
a: f,
|
|
10
|
+
u: v,
|
|
11
|
+
w: C,
|
|
12
|
+
d: E
|
|
13
|
+
};
|
|
14
|
+
function S({
|
|
15
|
+
label: e,
|
|
16
|
+
value: n,
|
|
17
|
+
tone: s = "neutral",
|
|
18
|
+
labelMuted: r = !0,
|
|
19
|
+
className: l,
|
|
20
|
+
...o
|
|
21
|
+
}) {
|
|
22
|
+
const m = s === "accent" ? c.a : s === "success" ? c.u : s === "warning" ? c.w : s === "danger" ? c.d : c.n;
|
|
23
|
+
return /* @__PURE__ */ a.createElement(u, { className: t(c.r, m, l), ...o }, /* @__PURE__ */ a.createElement("span", { className: t(c.l, !r && c.le) }, e), /* @__PURE__ */ a.createElement("span", { className: c.v }, n));
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
S
|
|
27
|
+
};
|
package/dist/Stat.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer elcrm-components{.c4r{display:flex;flex-direction:column;gap:6px}.c4l{font-size:var(--shell-font-size-sm);font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--shell-color-muted);line-height:1.2}.c4le{color:var(--shell-color)}.c4v{font-size:var(--stat-value-size, 1.75rem);font-weight:700;letter-spacing:-.03em;line-height:1.1;color:var(--shell-color)}.c4a .c4v{color:var(--shell-color-accent)}.c4u .c4v{color:var(--shell-color-success)}.c4w .c4v{color:var(--shell-color-warning)}.c4d .c4v{color:var(--shell-color-danger)}}
|
package/dist/Stat.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** Тон числа — те же смыслы, что у Badge */
|
|
3
|
+
export type StatTone = "neutral" | "accent" | "success" | "warning" | "danger";
|
|
4
|
+
/**
|
|
5
|
+
* Карточка-метрика: подпись сверху, крупное число снизу.
|
|
6
|
+
*
|
|
7
|
+
* Роли: сводка на PageHead / над списком. Не заменяет Card с произвольным контентом.
|
|
8
|
+
*
|
|
9
|
+
* @param label подпись (обычно uppercase в CSS)
|
|
10
|
+
* @param value число или короткий текст
|
|
11
|
+
* @param tone цвет значения
|
|
12
|
+
* @param labelMuted приглушённая подпись (выключить для «всего»)
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <Stack direction="grid" gap={12}>
|
|
17
|
+
* <Stat label="Всего" value={10} labelMuted={false} />
|
|
18
|
+
* <Stat label="Admin" value={6} tone="accent" />
|
|
19
|
+
* </Stack>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* Токены: `--shell-*`, размер числа — `--stat-value-size`.
|
|
23
|
+
*/
|
|
24
|
+
export type StatProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
25
|
+
/** Подпись метрики */
|
|
26
|
+
label: React.ReactNode;
|
|
27
|
+
/** Значение */
|
|
28
|
+
value: React.ReactNode;
|
|
29
|
+
/** Цвет числа */
|
|
30
|
+
tone?: StatTone;
|
|
31
|
+
/** Приглушить подпись (по умолчанию да) */
|
|
32
|
+
labelMuted?: boolean;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Карточка-метрика (обёртка над Card).
|
|
36
|
+
*
|
|
37
|
+
* @see Card, Stack, Badge
|
|
38
|
+
*/
|
|
39
|
+
export declare function Stat({ label, value, tone, labelMuted, className, ...rest }: StatProps): React.JSX.Element;
|
package/dist/Stat.js
ADDED
package/dist/TabSections.js
CHANGED