@elcrm/components 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +11 -0
  2. package/dist/{AvatarGroup-Dq-UrOaC.js → AvatarGroup-DeceOhGV.js} +29 -26
  3. package/dist/AvatarGroup.js +1 -1
  4. package/dist/{Breadcrumb-DM_hWw5n.js → Breadcrumb-BexTTfCV.js} +42 -29
  5. package/dist/Breadcrumb.js +1 -1
  6. package/dist/CodeBlock-CZFC4r35.js +37 -0
  7. package/dist/CodeBlock.js +1 -1
  8. package/dist/Dropdown-C9rbsSgR.js +190 -0
  9. package/dist/Dropdown.js +1 -1
  10. package/dist/{Healthmap-Z-LLfGW0.js → Healthmap-B4h6_9Yv.js} +130 -123
  11. package/dist/Healthmap.js +1 -1
  12. package/dist/Menu-CR2CclSe.js +76 -0
  13. package/dist/Menu.js +1 -1
  14. package/dist/PageHead-BjBvWtlk.js +33 -0
  15. package/dist/PageHead.d.ts +7 -1
  16. package/dist/PageHead.js +1 -1
  17. package/dist/{PanelInfo-Db5GCr-c.js → PanelInfo-BTkDUF-p.js} +61 -58
  18. package/dist/PanelInfo.js +1 -1
  19. package/dist/Popover.d.ts +1 -1
  20. package/dist/{PricingTable-BjpGVAhi.js → PricingTable-Dt2wsnEz.js} +56 -53
  21. package/dist/PricingTable.js +1 -1
  22. package/dist/Section-C5XfBTfd.js +48 -0
  23. package/dist/Section.d.ts +8 -1
  24. package/dist/Section.js +1 -1
  25. package/dist/{Sidebar-Bouhd5SS.js → Sidebar-C5vMwV9L.js} +77 -74
  26. package/dist/Sidebar.js +1 -1
  27. package/dist/TabSections-CEM_8Fjy.js +87 -0
  28. package/dist/TabSections.js +1 -1
  29. package/dist/index.es.js +12 -12
  30. package/dist/kit-manifest.json +12 -2
  31. package/package.json +1 -1
  32. package/dist/CodeBlock-B3wvMejv.js +0 -34
  33. package/dist/Dropdown-CR_XxNak.js +0 -185
  34. package/dist/Menu-u0WnWjT-.js +0 -73
  35. package/dist/PageHead-BfClTLrF.js +0 -31
  36. package/dist/Section-PprWjOvt.js +0 -47
  37. package/dist/TabSections-Dppe9wiz.js +0 -84
@@ -1,39 +1,40 @@
1
1
  import e from "react";
2
- import { D as M } from "./Dropdown-CR_XxNak.js";
2
+ import { Button as L } from "@elcrm/button";
3
+ import { D as M } from "./Dropdown-C9rbsSgR.js";
3
4
  import { c as x } from "./cx-CcykAxZN.js";
4
- import { c as O, b as P, a as j, i as z } from "./navTree-BRyaILN9.js";
5
- import { h as A } from "./rovingKeys-Di9N1Nct.js";
6
- import { u as q } from "./useControllableValue-BaE0VR5d.js";
7
- import { B as T } from "./Badge-BjScAXGy.js";
8
- import { I as W } from "./Item-CGpkMJu0.js";
9
- import { b as G } from "./badgeText-CRzlIzi3.js";
10
- import './Sidebar.css';const H = "nsr", J = "nsb", Q = "nsx", U = "nsg", V = "nss", X = "nsp", Y = "nsh", Z = "nsn", _ = "nsi", $ = "nsa", ee = "nso", ne = "nsl", te = "nsd", ae = "nsc", le = "nsm", se = "nsf", ce = "nsq", re = "nsw", oe = "nsu", ie = "nsk", ue = "nsv", n = {
11
- root: H,
12
- brand: J,
13
- xtra: Q,
14
- groups: U,
15
- section: V,
16
- plain: X,
17
- heading: Y,
18
- nav: Z,
19
- item: _,
20
- active: $,
21
- oico: ee,
22
- label: ne,
23
- dot: te,
24
- chevron: ae,
25
- menu: le,
26
- footer: se,
27
- qmenu: ce,
28
- who: re,
29
- userbtn: oe,
30
- kebab: ie,
31
- ver: ue
5
+ import { c as O, b as P, a as j, i as A } from "./navTree-BRyaILN9.js";
6
+ import { h as T } from "./rovingKeys-Di9N1Nct.js";
7
+ import { u as K } from "./useControllableValue-BaE0VR5d.js";
8
+ import { B as W } from "./Badge-BjScAXGy.js";
9
+ import { I as G } from "./Item-CGpkMJu0.js";
10
+ import { b as H } from "./badgeText-CRzlIzi3.js";
11
+ import './Sidebar.css';const J = "nsr", Q = "nsb", U = "nsx", V = "nsg", X = "nss", Y = "nsp", Z = "nsh", _ = "nsn", $ = "nsi", ee = "nsa", ne = "nso", te = "nsl", ae = "nsd", le = "nsc", se = "nsm", ce = "nsf", re = "nsq", oe = "nsw", ie = "nsu", ue = "nsk", me = "nsv", n = {
12
+ root: J,
13
+ brand: Q,
14
+ xtra: U,
15
+ groups: V,
16
+ section: X,
17
+ plain: Y,
18
+ heading: Z,
19
+ nav: _,
20
+ item: $,
21
+ active: ee,
22
+ oico: ne,
23
+ label: te,
24
+ dot: ae,
25
+ chevron: le,
26
+ menu: se,
27
+ footer: ce,
28
+ qmenu: re,
29
+ who: oe,
30
+ userbtn: ie,
31
+ kebab: ue,
32
+ ver: me
32
33
  };
33
- function me({ className: s }) {
34
+ function de({ className: s }) {
34
35
  return /* @__PURE__ */ e.createElement("svg", { className: s, viewBox: "0 0 16 16", "aria-hidden": !0 }, /* @__PURE__ */ e.createElement("circle", { cx: "8", cy: "3", r: "1.3", fill: "currentColor" }), /* @__PURE__ */ e.createElement("circle", { cx: "8", cy: "8", r: "1.3", fill: "currentColor" }), /* @__PURE__ */ e.createElement("circle", { cx: "8", cy: "13", r: "1.3", fill: "currentColor" }));
35
36
  }
36
- function de({ className: s }) {
37
+ function ve({ className: s }) {
37
38
  return /* @__PURE__ */ e.createElement("svg", { className: s, viewBox: "0 0 12 12", "aria-hidden": !0 }, /* @__PURE__ */ e.createElement(
38
39
  "path",
39
40
  {
@@ -46,18 +47,18 @@ function de({ className: s }) {
46
47
  }
47
48
  ));
48
49
  }
49
- function B({
50
+ function q({
50
51
  items: s,
51
52
  value: v,
52
- focusValue: b,
53
- open: p,
53
+ focusValue: p,
54
+ open: E,
54
55
  onValueChange: d,
55
- onToggle: E
56
+ onToggle: b
56
57
  }) {
57
58
  return /* @__PURE__ */ e.createElement(e.Fragment, null, s.map((a) => {
58
- const f = a.items, c = f != null && f.length > 0, o = c && p.includes(a.value), i = G(a.badge), u = !c && v === a.value, N = a.value === (b ?? v);
59
+ const f = a.items, c = f != null && f.length > 0, o = c && E.includes(a.value), i = H(a.badge), u = !c && v === a.value, N = a.value === (p ?? v);
59
60
  return /* @__PURE__ */ e.createElement("li", { key: a.value }, /* @__PURE__ */ e.createElement(
60
- W,
61
+ G,
61
62
  {
62
63
  as: "button",
63
64
  active: u,
@@ -68,33 +69,33 @@ function B({
68
69
  "data-open": o ? "true" : void 0,
69
70
  tabIndex: N ? 0 : -1,
70
71
  onClick: () => {
71
- c ? E(a.value) : d == null || d(a.value);
72
+ c ? b(a.value) : d == null || d(a.value);
72
73
  }
73
74
  },
74
75
  a.icon != null ? /* @__PURE__ */ e.createElement("span", { className: n.oico, "aria-hidden": !0 }, a.icon) : null,
75
76
  /* @__PURE__ */ e.createElement("span", { className: n.label }, a.label),
76
- i != null ? /* @__PURE__ */ e.createElement(T, { className: n.dot, tone: "accent", size: "s" }, i) : null,
77
- c ? /* @__PURE__ */ e.createElement(de, { className: n.chevron }) : null
77
+ i != null ? /* @__PURE__ */ e.createElement(W, { className: n.dot, tone: "accent", size: "s" }, i) : null,
78
+ c ? /* @__PURE__ */ e.createElement(ve, { className: n.chevron }) : null
78
79
  ), c && o ? /* @__PURE__ */ e.createElement("ul", { className: n.menu }, /* @__PURE__ */ e.createElement(
79
- B,
80
+ q,
80
81
  {
81
82
  items: f,
82
83
  value: v,
83
- focusValue: b,
84
- open: p,
84
+ focusValue: p,
85
+ open: E,
85
86
  onValueChange: d,
86
- onToggle: E
87
+ onToggle: b
87
88
  }
88
89
  )) : null);
89
90
  }));
90
91
  }
91
- function xe({
92
+ function ye({
92
93
  groups: s = [],
93
94
  value: v,
94
- defaultValue: b,
95
- onValueChange: p,
95
+ defaultValue: p,
96
+ onValueChange: E,
96
97
  open: d,
97
- defaultOpen: E,
98
+ defaultOpen: b,
98
99
  onOpenChange: a,
99
100
  variant: f = "cards",
100
101
  brand: c,
@@ -107,31 +108,31 @@ function xe({
107
108
  className: D,
108
109
  "aria-label": S = "Основное меню"
109
110
  }) {
110
- const [l, y] = q(
111
+ const [l, w] = K(
111
112
  v,
112
- b,
113
- p
114
- ), [m = [], k] = q(
113
+ p,
114
+ E
115
+ ), [m = [], g] = K(
115
116
  d,
116
- O(s, E, l),
117
+ O(s, b, l),
117
118
  a
118
- ), g = e.useRef(l);
119
+ ), k = e.useRef(l);
119
120
  e.useEffect(() => {
120
- if (l == null || l === g.current) {
121
- g.current = l;
121
+ if (l == null || l === k.current) {
122
+ k.current = l;
122
123
  return;
123
124
  }
124
- g.current = l;
125
- const r = P(s, l).filter((L) => !m.includes(L));
126
- r.length && k([...m, ...r]);
127
- }, [l, s, m, k]);
125
+ k.current = l;
126
+ const r = P(s, l).filter((F) => !m.includes(F));
127
+ r.length && g([...m, ...r]);
128
+ }, [l, s, m, g]);
128
129
  const I = (t) => {
129
- k(
130
+ g(
130
131
  m.includes(t) ? m.filter((r) => r !== t) : [...m, t]
131
132
  );
132
- }, w = e.useRef(null), F = j(s).map((t) => t.value), [R, K] = e.useState(l);
133
+ }, y = e.useRef(null), z = j(s).map((t) => t.value), [R, B] = e.useState(l);
133
134
  return e.useEffect(() => {
134
- l && K(l);
135
+ l && B(l);
135
136
  }, [l]), /* @__PURE__ */ e.createElement(
136
137
  "aside",
137
138
  {
@@ -142,15 +143,15 @@ function xe({
142
143
  /* @__PURE__ */ e.createElement(
143
144
  "div",
144
145
  {
145
- ref: w,
146
+ ref: y,
146
147
  className: n.groups,
147
- onKeyDown: (t) => A(t, {
148
- values: F,
148
+ onKeyDown: (t) => T(t, {
149
+ values: z,
149
150
  value: R,
150
151
  vertical: !0,
151
- focusRoot: w.current,
152
+ focusRoot: y.current,
152
153
  onSelect: (r) => {
153
- K(r), z(s, r) || y(r);
154
+ B(r), A(s, r) || w(r);
154
155
  }
155
156
  })
156
157
  },
@@ -163,13 +164,13 @@ function xe({
163
164
  },
164
165
  t.title ? /* @__PURE__ */ e.createElement("div", { className: n.heading }, t.title) : null,
165
166
  /* @__PURE__ */ e.createElement("ul", { className: n.nav }, /* @__PURE__ */ e.createElement(
166
- B,
167
+ q,
167
168
  {
168
169
  items: t.items ?? [],
169
170
  value: l,
170
171
  focusValue: R,
171
172
  open: m,
172
- onValueChange: y,
173
+ onValueChange: w,
173
174
  onToggle: I
174
175
  }
175
176
  ))
@@ -184,15 +185,17 @@ function xe({
184
185
  placement: "top",
185
186
  label: C,
186
187
  trigger: (t) => /* @__PURE__ */ e.createElement(
187
- "button",
188
+ L,
188
189
  {
189
- type: "button",
190
+ variant: "ghost",
191
+ size: "m",
192
+ width: "s",
190
193
  className: n.userbtn,
191
194
  "data-open": t.open ? "true" : void 0,
192
195
  ...t.anchorProps
193
196
  },
194
197
  /* @__PURE__ */ e.createElement("span", { className: n.who }, i),
195
- /* @__PURE__ */ e.createElement(me, { className: n.kebab })
198
+ /* @__PURE__ */ e.createElement(de, { className: n.kebab })
196
199
  ),
197
200
  items: u,
198
201
  onValueChange: N
@@ -201,5 +204,5 @@ function xe({
201
204
  );
202
205
  }
203
206
  export {
204
- xe as S
207
+ ye as S
205
208
  };
package/dist/Sidebar.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as e } from "./Sidebar-Bouhd5SS.js";
1
+ import { S as e } from "./Sidebar-C5vMwV9L.js";
2
2
  export {
3
3
  e as Sidebar
4
4
  };
@@ -0,0 +1,87 @@
1
+ import a, { useMemo as y, useId as x, useRef as h, Suspense as w } from "react";
2
+ import { Button as C } from "@elcrm/button";
3
+ import { c as f } from "./cx-CcykAxZN.js";
4
+ import { h as K } from "./rovingKeys-Di9N1Nct.js";
5
+ import { u as S } from "./useControllableValue-BaE0VR5d.js";
6
+ import './TabSections.css';const T = "ntr", z = "ntb", B = "ntn", D = "ntt", M = "nta", P = "nte", j = "nts", q = "ntm", t = {
7
+ root: T,
8
+ bar: z,
9
+ nav: B,
10
+ tab: D,
11
+ active: M,
12
+ ember: P,
13
+ slot: j,
14
+ main: q
15
+ };
16
+ function L({
17
+ items: s = [],
18
+ resolveSection: u,
19
+ children: o,
20
+ value: p,
21
+ defaultValue: r,
22
+ onValueChange: E,
23
+ loading: N = null,
24
+ actions: b,
25
+ className: g,
26
+ navLabel: I = "Вкладки"
27
+ }) {
28
+ const R = y(() => {
29
+ var e;
30
+ return r || (((e = s.find((n) => !n.disabled)) == null ? void 0 : e.value) ?? "");
31
+ }, [r, s]), [l, d] = S(
32
+ p,
33
+ R,
34
+ E
35
+ ), $ = s.filter((e) => !e.disabled).map((e) => e.value), c = x(), v = h(null), m = `${c}-panel`, i = o == null && l && u ? u(l) : null;
36
+ return /* @__PURE__ */ a.createElement("div", { className: f(t.root, g) }, /* @__PURE__ */ a.createElement("div", { className: t.bar }, /* @__PURE__ */ a.createElement(
37
+ "nav",
38
+ {
39
+ ref: v,
40
+ className: t.nav,
41
+ "aria-label": I,
42
+ role: "tablist",
43
+ onKeyDown: (e) => K(e, {
44
+ values: $,
45
+ value: l,
46
+ onSelect: d,
47
+ focusRoot: v.current
48
+ })
49
+ },
50
+ s.map((e) => {
51
+ const n = e.value === l, k = `${c}-tab-${e.value}`;
52
+ return /* @__PURE__ */ a.createElement(
53
+ C,
54
+ {
55
+ key: e.value,
56
+ id: k,
57
+ variant: "ghost",
58
+ size: "m",
59
+ width: "s",
60
+ role: "tab",
61
+ className: f(t.tab, n && t.active),
62
+ "data-value": e.value,
63
+ "data-active": n ? "true" : void 0,
64
+ "aria-selected": n,
65
+ "aria-controls": m,
66
+ tabIndex: n ? 0 : -1,
67
+ disabled: e.disabled,
68
+ onClick: () => d(e.value)
69
+ },
70
+ /* @__PURE__ */ a.createElement("span", null, e.label),
71
+ e.badge != null && e.badge !== "" ? /* @__PURE__ */ a.createElement("em", { className: t.ember }, e.badge) : null
72
+ );
73
+ })
74
+ ), b != null ? /* @__PURE__ */ a.createElement("div", { className: t.slot }, b) : null), /* @__PURE__ */ a.createElement(
75
+ "div",
76
+ {
77
+ id: m,
78
+ className: t.main,
79
+ role: "tabpanel",
80
+ "aria-labelledby": l ? `${c}-tab-${l}` : void 0
81
+ },
82
+ o ?? (i ? /* @__PURE__ */ a.createElement(w, { fallback: N }, a.createElement(i)) : null)
83
+ ));
84
+ }
85
+ export {
86
+ L as T
87
+ };
@@ -1,4 +1,4 @@
1
- import { T as e } from "./TabSections-Dppe9wiz.js";
1
+ import { T as e } from "./TabSections-CEM_8Fjy.js";
2
2
  export {
3
3
  e as TabSections
4
4
  };
package/dist/index.es.js CHANGED
@@ -11,32 +11,32 @@ import { T as G } from "./TextGroup-236jHxdT.js";
11
11
  import { T as R } from "./Text-Bo1u7gVC.js";
12
12
  import { S as O } from "./Stat-p8j4PjrC.js";
13
13
  import { S as M, s as Z } from "./Stack-BPTehVYc.js";
14
- import { M as w } from "./Menu-u0WnWjT-.js";
15
- import { D } from "./Dropdown-CR_XxNak.js";
16
- import { B as j } from "./Breadcrumb-DM_hWw5n.js";
14
+ import { M as w } from "./Menu-CR2CclSe.js";
15
+ import { D } from "./Dropdown-C9rbsSgR.js";
16
+ import { B as j } from "./Breadcrumb-BexTTfCV.js";
17
17
  import { L as J } from "./Loading-C_CKD-zt.js";
18
- import { S as Q } from "./Section-PprWjOvt.js";
18
+ import { S as Q } from "./Section-C5XfBTfd.js";
19
19
  import { N as V } from "./NavSections-CNxxBMPT.js";
20
- import { T as X } from "./TabSections-Dppe9wiz.js";
20
+ import { T as X } from "./TabSections-CEM_8Fjy.js";
21
21
  import { A as _, a as $, i as rr } from "./Avatar-eGdLrMCv.js";
22
- import { A as ar } from "./AvatarGroup-Dq-UrOaC.js";
22
+ import { A as ar } from "./AvatarGroup-DeceOhGV.js";
23
23
  import { A as tr } from "./AvatarName-3B4yCxHn.js";
24
24
  import { B as pr } from "./Badge-BjScAXGy.js";
25
25
  import { B as fr } from "./Brand-BfCuiyf7.js";
26
26
  import { E as lr } from "./EmptyState-B_wWPjUu.js";
27
27
  import { R as ir } from "./RadioGroup-DI4KKUvZ.js";
28
28
  import { P as ur } from "./PricingGroup-CWy47MlE.js";
29
- import { P as Sr } from "./PricingTable-BjpGVAhi.js";
30
- import { P as Tr } from "./PageHead-BfClTLrF.js";
29
+ import { P as Sr } from "./PricingTable-Dt2wsnEz.js";
30
+ import { P as Tr } from "./PageHead-BjBvWtlk.js";
31
31
  import { P as Cr } from "./PageShell-BAJges-G.js";
32
32
  import { C as Br, a as Ir } from "./ChatSplit-8iw_1Shp.js";
33
33
  import { C as hr } from "./ChatMessages-CLxwRGIa.js";
34
- import { S as Lr } from "./Sidebar-Bouhd5SS.js";
34
+ import { S as Lr } from "./Sidebar-C5vMwV9L.js";
35
35
  import { P as Gr } from "./Popover-xEZoMY-h.js";
36
- import { H as Rr } from "./Healthmap-Z-LLfGW0.js";
37
- import { P as Or } from "./PanelInfo-Db5GCr-c.js";
36
+ import { H as Rr } from "./Healthmap-B4h6_9Yv.js";
37
+ import { P as Or } from "./PanelInfo-BTkDUF-p.js";
38
38
  import { T as Mr } from "./Table-DqrDUUtb.js";
39
- import { C as gr } from "./CodeBlock-B3wvMejv.js";
39
+ import { C as gr } from "./CodeBlock-CZFC4r35.js";
40
40
  import { S as zr, c as Dr } from "./SplitPane-DBa-g9td.js";
41
41
  import { B as jr } from "./Banner-DAY18FWO.js";
42
42
  import { I as Jr } from "./IconButton-DPjpBKJn.js";
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "format": "elcrm-kit-manifest-v1",
3
3
  "package": "@elcrm/components",
4
- "version": "0.5.4",
4
+ "version": "0.5.5",
5
5
  "pkg": "components",
6
- "generatedAt": "2026-09-11T00:17:51.201Z",
6
+ "generatedAt": "2026-10-22T12:58:01.267Z",
7
7
  "components": [
8
8
  {
9
9
  "slug": "ActionGroup",
@@ -871,6 +871,11 @@
871
871
  "type": "React.ReactNode",
872
872
  "description": "Подзаголовок"
873
873
  },
874
+ {
875
+ "name": "headingLevel",
876
+ "type": "\"h1\" | \"h2\" | \"div\"",
877
+ "description": "HTML-тег заголовка. По умолчанию `h1`: PageHead — заголовок страницы. `div` — если семантический заголовок уже есть во внешнем layout."
878
+ },
874
879
  {
875
880
  "name": "actions",
876
881
  "type": "React.ReactNode",
@@ -1259,6 +1264,11 @@
1259
1264
  "type": "\"md\" | \"lg\"",
1260
1265
  "description": "Размер заголовка"
1261
1266
  },
1267
+ {
1268
+ "name": "titleAs",
1269
+ "type": "\"h1\" | \"h2\" | \"h3\" | \"div\"",
1270
+ "description": "HTML-тег заголовка. По умолчанию — `div` для `page`/`auth` и `h2` для `block`, чтобы не дублировать `h1` из PageHead. Явно `h1` — только если Section сам заголовок страницы."
1271
+ },
1262
1272
  {
1263
1273
  "name": "direction",
1264
1274
  "type": "StackDirection",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elcrm/components",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
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>",
@@ -1,34 +0,0 @@
1
- import e from "react";
2
- import { c as u } from "./cx-CcykAxZN.js";
3
- import './CodeBlock.css';const d = "dcr", E = "dcb", b = "dcp", N = "dca", f = "dcc", t = {
4
- root: d,
5
- bar: E,
6
- pre: b,
7
- actions: N,
8
- copy: f
9
- };
10
- function y({
11
- title: r,
12
- code: a,
13
- children: s,
14
- onCopy: c,
15
- copyLabel: n = "Копировать",
16
- actions: l,
17
- className: m,
18
- ...i
19
- }) {
20
- const o = typeof n == "string" && n.trim() ? n.trim() : "Копировать", p = s ?? (a != null ? /* @__PURE__ */ e.createElement("code", null, a) : null);
21
- return /* @__PURE__ */ e.createElement("div", { className: u(t.root, m), ...i }, r != null || c || l ? /* @__PURE__ */ e.createElement("div", { className: t.bar }, /* @__PURE__ */ e.createElement("span", null, r ?? "Код"), /* @__PURE__ */ e.createElement("div", { className: t.actions }, l, c ? /* @__PURE__ */ e.createElement(
22
- "button",
23
- {
24
- type: "button",
25
- className: t.copy,
26
- "aria-label": o,
27
- onClick: c
28
- },
29
- o
30
- ) : null)) : null, /* @__PURE__ */ e.createElement("pre", { className: t.pre }, p));
31
- }
32
- export {
33
- y as C
34
- };
@@ -1,185 +0,0 @@
1
- import n, { useRef as A, useEffect as K } from "react";
2
- import { c as u } from "./cx-CcykAxZN.js";
3
- import { P as T } from "./Popover-xEZoMY-h.js";
4
- import { h as W } from "./rovingKeys-Di9N1Nct.js";
5
- import { u as G } from "./Toolbar-Bl9-5Mis.js";
6
- import { u as H } from "./useControllableValue-BaE0VR5d.js";
7
- import { C as S } from "./CheckIcon-FdB8fMEF.js";
8
- import './Dropdown.css';const $ = "ldr", J = "lda", Q = "ldt", U = "ldc", X = "ldp", Y = "ldh", Z = "ldg", _ = "ldd", V = "ldi", ee = "ldn", ne = "ldm", te = "ldk", le = "ldl", ae = "ldu", ce = "ldb", oe = "ldo", re = "ldf", se = "ldx", ue = "ldy", de = "ldv", ie = "lde", fe = "lds", l = {
9
- root: $,
10
- anchor: J,
11
- trigger: Q,
12
- chevron: U,
13
- panel: X,
14
- heading: Y,
15
- group: Z,
16
- divider: _,
17
- item: V,
18
- none: ee,
19
- more: ne,
20
- kcheck: te,
21
- label: le,
22
- ushort: ae,
23
- bead: ce,
24
- online: oe,
25
- foff: re,
26
- xbox: se,
27
- yes: ue,
28
- vtick: de,
29
- elevated: ie,
30
- surface: fe
31
- };
32
- function he() {
33
- return /* @__PURE__ */ n.createElement("svg", { className: l.chevron, viewBox: "0 0 12 12", "aria-hidden": !0 }, /* @__PURE__ */ n.createElement(
34
- "path",
35
- {
36
- d: "M2.5 4.5 6 8l3.5-3.5",
37
- fill: "none",
38
- stroke: "currentColor",
39
- strokeWidth: "1.5",
40
- strokeLinecap: "round",
41
- strokeLinejoin: "round"
42
- }
43
- ));
44
- }
45
- function me() {
46
- return /* @__PURE__ */ n.createElement("svg", { className: l.more, viewBox: "0 0 12 12", "aria-hidden": !0 }, /* @__PURE__ */ n.createElement(
47
- "path",
48
- {
49
- d: "M4.5 2.5 8 6l-3.5 3.5",
50
- fill: "none",
51
- stroke: "currentColor",
52
- strokeWidth: "1.5",
53
- strokeLinecap: "round",
54
- strokeLinejoin: "round"
55
- }
56
- ));
57
- }
58
- function ke({ item: a }) {
59
- return a.checkbox ? /* @__PURE__ */ n.createElement("span", { className: u(l.xbox, a.checked && l.yes), "aria-hidden": !0 }, a.checked ? /* @__PURE__ */ n.createElement(S, { className: l.vtick }) : null) : a.checked ? /* @__PURE__ */ n.createElement("span", { className: l.kcheck, "aria-hidden": !0 }, /* @__PURE__ */ n.createElement(S, { className: l.vtick })) : a.status != null ? /* @__PURE__ */ n.createElement(
60
- "span",
61
- {
62
- className: u(l.bead, a.status === "online" ? l.online : l.foff),
63
- "aria-hidden": !0
64
- }
65
- ) : a.icon != null ? /* @__PURE__ */ n.createElement("span", { className: l.none }, a.icon) : null;
66
- }
67
- function ve(a, o, c) {
68
- return o != null && o.length > 0 ? c != null && o[0] && o[0].title == null ? [{ ...o[0], title: c }, ...o.slice(1)] : o : a != null && a.length > 0 ? [{ title: c, items: a }] : c != null ? [{ title: c, items: [] }] : [];
69
- }
70
- function Se({
71
- items: a,
72
- groups: o,
73
- trigger: c,
74
- label: d,
75
- hideChevron: g = !1,
76
- title: L,
77
- align: E = "end",
78
- placement: R = "auto",
79
- open: w,
80
- defaultOpen: z = !1,
81
- onOpenChange: D,
82
- closeOnSelect: M = !0,
83
- disabled: i = !1,
84
- size: O,
85
- tone: N = "default",
86
- onValueChange: f,
87
- className: P
88
- }) {
89
- const h = G(), B = O ?? (h == null ? void 0 : h.size), [m = !1, x] = H(
90
- w,
91
- z,
92
- D
93
- ), y = ve(a, o, L), k = A(null), v = y.flatMap((e) => e.items).filter((e) => !e.disabled).map((e) => e.value), [C, p] = n.useState(v[0] ?? ""), b = N === "account";
94
- K(() => {
95
- if (!m) return;
96
- const e = v[0];
97
- e && (p(e), requestAnimationFrame(() => {
98
- var t;
99
- const r = (t = k.current) == null ? void 0 : t.querySelector(
100
- `[data-value="${typeof CSS < "u" && CSS.escape ? CSS.escape(e) : e.replace(/"/g, '\\"')}"]`
101
- );
102
- r instanceof HTMLElement && r.focus();
103
- }));
104
- }, [m]);
105
- const F = (e) => {
106
- var t;
107
- if (e.disabled) return;
108
- (t = e.onClick) == null || t.call(e), f == null || f(e.value, e), e.checkbox || e.submenu || !M || x(!1);
109
- };
110
- return /* @__PURE__ */ n.createElement(
111
- T,
112
- {
113
- className: u(l.root, P),
114
- open: m,
115
- onOpenChange: (e) => {
116
- i || x(e);
117
- },
118
- align: E,
119
- placement: R,
120
- label: typeof d == "string" ? d : void 0,
121
- disabled: i,
122
- role: "menu",
123
- panelClassName: b ? l.elevated : void 0,
124
- fitContent: b,
125
- trigger: (e) => typeof c == "function" ? c(e) : c != null ? /* @__PURE__ */ n.createElement("span", { className: l.anchor, ...e.anchorProps }, c) : /* @__PURE__ */ n.createElement(
126
- "button",
127
- {
128
- type: "button",
129
- className: l.trigger,
130
- "data-size": B,
131
- "data-open": e.open ? "true" : void 0,
132
- disabled: i,
133
- ...e.anchorProps
134
- },
135
- d,
136
- g ? null : /* @__PURE__ */ n.createElement(he, null)
137
- )
138
- },
139
- /* @__PURE__ */ n.createElement(
140
- "div",
141
- {
142
- ref: k,
143
- className: u(l.panel, b && l.surface),
144
- "data-align": E,
145
- "data-tone": N,
146
- onKeyDown: (e) => W(e, {
147
- values: v,
148
- value: C,
149
- vertical: !0,
150
- focusRoot: k.current,
151
- onSelect: p
152
- })
153
- },
154
- y.map((e, r) => /* @__PURE__ */ n.createElement(n.Fragment, { key: e.value ?? e.title ?? r }, r > 0 ? /* @__PURE__ */ n.createElement("hr", { className: l.divider }) : null, /* @__PURE__ */ n.createElement("div", { className: l.group, role: "group" }, e.title != null ? /* @__PURE__ */ n.createElement("p", { className: l.heading }, e.title) : null, e.items.map((t) => {
155
- const I = e.items.some(
156
- (s) => s.checked || s.checkbox || s.status != null || s.icon != null
157
- ), j = /* @__PURE__ */ n.createElement(ke, { item: t }), q = t.checkbox === !0 || t.checked != null;
158
- return /* @__PURE__ */ n.createElement(
159
- "button",
160
- {
161
- key: t.value,
162
- type: "button",
163
- role: t.checkbox ? "menuitemcheckbox" : "menuitem",
164
- className: l.item,
165
- "data-value": t.value,
166
- "data-checked": (t.checked || t.checkbox) && t.checked ? "true" : void 0,
167
- "data-danger": t.danger ? "true" : void 0,
168
- tabIndex: t.value === C ? 0 : -1,
169
- disabled: t.disabled,
170
- "aria-checked": q ? !!t.checked : void 0,
171
- onClick: () => F(t),
172
- onFocus: () => p(t.value)
173
- },
174
- I ? j ?? /* @__PURE__ */ n.createElement("span", { className: l.none, "aria-hidden": !0 }) : null,
175
- t.label != null ? /* @__PURE__ */ n.createElement("span", { className: l.label }, t.label) : null,
176
- t.shortcut != null ? /* @__PURE__ */ n.createElement("span", { className: l.ushort }, t.shortcut) : null,
177
- t.submenu ? /* @__PURE__ */ n.createElement(me, null) : null
178
- );
179
- }))))
180
- )
181
- );
182
- }
183
- export {
184
- Se as D
185
- };