@elcrm/components 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +66 -2
  2. package/dist/ActionGroup.css +1 -1
  3. package/dist/Avatar.d.ts +2 -1
  4. package/dist/AvatarGroup.d.ts +2 -1
  5. package/dist/AvatarName-0BzyfpMq.js +68 -0
  6. package/dist/AvatarName.css +1 -1
  7. package/dist/AvatarName.d.ts +4 -1
  8. package/dist/AvatarName.js +1 -1
  9. package/dist/Badge.d.ts +2 -1
  10. package/dist/Card.css +1 -1
  11. package/dist/ChatFrame-BW2TmCkZ.js +37 -0
  12. package/dist/ChatFrame.css +1 -0
  13. package/dist/ChatList.d.ts +9 -0
  14. package/dist/ChatList.js +7 -0
  15. package/dist/ChatMessages-B8rdXiK-.js +19 -0
  16. package/dist/ChatMessages.d.ts +9 -0
  17. package/dist/ChatMessages.js +4 -0
  18. package/dist/ChatSplit-DNnu3TNq.js +21 -0
  19. package/dist/CheckIcon-FdB8fMEF.js +17 -0
  20. package/dist/CheckIcon.d.ts +8 -0
  21. package/dist/Dropdown-4yUB2tk1.js +142 -0
  22. package/dist/Dropdown.css +1 -1
  23. package/dist/Dropdown.js +1 -1
  24. package/dist/Footer.css +1 -1
  25. package/dist/Item.css +1 -1
  26. package/dist/ItemColumn.css +1 -1
  27. package/dist/ItemColumn.d.ts +2 -1
  28. package/dist/Layout-mi6Ghayv.js +31 -0
  29. package/dist/Layout.css +1 -1
  30. package/dist/Layout.d.ts +19 -2
  31. package/dist/Layout.js +1 -1
  32. package/dist/Loading-DkkG7RcE.js +16 -0
  33. package/dist/Loading.css +1 -1
  34. package/dist/Loading.d.ts +1 -1
  35. package/dist/Loading.js +1 -1
  36. package/dist/Menu-DuXQv-zT.js +66 -0
  37. package/dist/Menu.css +1 -1
  38. package/dist/Menu.js +1 -1
  39. package/dist/NavSections-BpyZPimZ.js +79 -0
  40. package/dist/NavSections.css +1 -1
  41. package/dist/NavSections.js +1 -1
  42. package/dist/PageHead.css +1 -1
  43. package/dist/Popover-D0m5JWIt.js +142 -0
  44. package/dist/Popover.css +1 -1
  45. package/dist/Popover.js +1 -1
  46. package/dist/PricingGroup-Czuhe81Z.js +120 -0
  47. package/dist/PricingGroup.css +1 -1
  48. package/dist/PricingGroup.js +1 -1
  49. package/dist/{PricingTable-DALddSwM.js → PricingTable-BuLC0opK.js} +69 -75
  50. package/dist/PricingTable.css +1 -1
  51. package/dist/PricingTable.js +1 -1
  52. package/dist/RadioGroup-fcXzhvMu.js +129 -0
  53. package/dist/RadioGroup.css +1 -1
  54. package/dist/RadioGroup.js +1 -1
  55. package/dist/Sidebar-CBYq1ad6.js +107 -0
  56. package/dist/Sidebar.css +1 -1
  57. package/dist/Sidebar.d.ts +17 -1
  58. package/dist/Sidebar.js +1 -1
  59. package/dist/Stat.css +1 -1
  60. package/dist/TabSections-DN7yVJoF.js +69 -0
  61. package/dist/TabSections.css +1 -1
  62. package/dist/TabSections.js +1 -1
  63. package/dist/TextGroup.d.ts +2 -1
  64. package/dist/badgeText-CRzlIzi3.js +8 -0
  65. package/dist/badgeText.d.ts +4 -0
  66. package/dist/dark.css +4 -1
  67. package/dist/index.css +21 -19
  68. package/dist/index.d.ts +10 -1
  69. package/dist/index.es.d.ts +10 -1
  70. package/dist/index.es.js +51 -44
  71. package/dist/light.css +4 -1
  72. package/dist/rovingKeys-CGlfTtNQ.js +15 -0
  73. package/dist/rovingKeys.d.ts +13 -0
  74. package/dist/tokens.css +35 -14
  75. package/dist/types.d.ts +2 -0
  76. package/dist/useControllableValue-CWqH1kpM.js +10 -0
  77. package/dist/useControllableValue.d.ts +4 -0
  78. package/package.json +5 -1
  79. package/dist/AvatarName-C1sIDPH-.js +0 -66
  80. package/dist/Dropdown-CQBMF9aR.js +0 -151
  81. package/dist/Layout-BQwEaeO0.js +0 -22
  82. package/dist/Loading-ChGq9peU.js +0 -15
  83. package/dist/Menu-DpUvOl8Y.js +0 -58
  84. package/dist/NavSections-NDcIDD6H.js +0 -59
  85. package/dist/Popover-g2xTGubK.js +0 -123
  86. package/dist/PricingGroup-DgcdVSq8.js +0 -126
  87. package/dist/RadioGroup-D2UUOTkY.js +0 -138
  88. package/dist/Sidebar-DeqxYgxn.js +0 -69
  89. package/dist/TabSections-Bf_sZo7b.js +0 -50
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Controlled / uncontrolled значение (как `value` + `defaultValue` у групп).
3
+ */
4
+ export declare function useControllableValue<T>(value: T | undefined, defaultValue: T | undefined, onChange?: (next: T) => void): [T | undefined, (next: T) => void];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elcrm/components",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Shell UI elCRM: Layout, Header, Sidebar, Popover, PageHead, PageShell, Section, Stack, Stat, ActionGroup, TextGroup, ItemColumn и др.",
5
5
  "type": "module",
6
6
  "author": "MaSkal <dev@elcrm.online>",
@@ -85,11 +85,14 @@
85
85
  "./package.json": "./package.json"
86
86
  },
87
87
  "scripts": {
88
+ "dev": "vite --config test/vite.config.ts",
88
89
  "build": "vite build",
89
90
  "postbuild": "node scripts/postbuild.mjs",
90
91
  "check:css": "node scripts/check-css-scoped.mjs",
91
92
  "check:tokens": "node scripts/check-tokens.mjs",
92
93
  "test": "vitest run",
94
+ "test:build": "vite build --config test/vite.config.ts",
95
+ "test:preview": "vite preview --config test/vite.config.ts",
93
96
  "prepublishOnly": "npm run check:css && npm run check:tokens && npm run test && npm run build",
94
97
  "pack:check": "npm pack --dry-run"
95
98
  },
@@ -104,6 +107,7 @@
104
107
  }
105
108
  },
106
109
  "devDependencies": {
110
+ "@elcrm/storybook": "file:../elCRM.storybook",
107
111
  "@testing-library/react": "^16.2.0",
108
112
  "@types/node": "^22.13.10",
109
113
  "@types/react": "^18.2.66",
@@ -1,66 +0,0 @@
1
- import t from "react";
2
- import { A as b } from "./Avatar-loGgFt72.js";
3
- import { c as g } from "./cx-CcykAxZN.js";
4
- import './AvatarName.css';const y = "czr", A = "czc", h = "czt", x = "czd", C = "czs", F = "czm", I = "czl", e = {
5
- r: y,
6
- c: A,
7
- t: h,
8
- d: x,
9
- s: C,
10
- m: F,
11
- l: I
12
- };
13
- function R(s, n) {
14
- if (s != null && s !== "") return s;
15
- if (typeof n == "string") return n;
16
- }
17
- function k(s) {
18
- const {
19
- src: n,
20
- name: c,
21
- title: m,
22
- description: i,
23
- size: a = "m",
24
- radius: f,
25
- status: p,
26
- className: z,
27
- children: E,
28
- as: u = "div",
29
- ...r
30
- } = s, N = a === "s" ? e.s : a === "l" ? e.l : e.m, l = g(e.r, N, z), d = m ?? (typeof c == "string" ? c : void 0), v = R(c, m), o = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
31
- b,
32
- {
33
- src: n,
34
- name: v,
35
- size: a,
36
- radius: f,
37
- status: p
38
- }
39
- ), /* @__PURE__ */ t.createElement("span", { className: e.c }, d != null ? /* @__PURE__ */ t.createElement("span", { className: e.t }, d) : null, i != null ? /* @__PURE__ */ t.createElement("span", { className: e.d }, i) : null, E));
40
- return u === "button" ? /* @__PURE__ */ t.createElement(
41
- "button",
42
- {
43
- type: "button",
44
- className: l,
45
- ...r
46
- },
47
- o
48
- ) : u === "a" ? /* @__PURE__ */ t.createElement(
49
- "a",
50
- {
51
- className: l,
52
- ...r
53
- },
54
- o
55
- ) : /* @__PURE__ */ t.createElement(
56
- "div",
57
- {
58
- className: l,
59
- ...r
60
- },
61
- o
62
- );
63
- }
64
- export {
65
- k as A
66
- };
@@ -1,151 +0,0 @@
1
- import e from "react";
2
- import { c as s } from "./cx-CcykAxZN.js";
3
- import { P as I } from "./Popover-g2xTGubK.js";
4
- import './Dropdown.css';const R = "crr", z = "crt", F = "crc", G = "crp", P = "crh", T = "crg", U = "crd", q = "cri", A = "crn", H = "crk", J = "crl", K = "cru", O = "crm", Q = "crb", V = "cro", X = "crf", Y = "crx", Z = "cry", _ = "crv", n = {
5
- r: R,
6
- t: z,
7
- c: F,
8
- p: G,
9
- h: P,
10
- g: T,
11
- d: U,
12
- i: q,
13
- n: A,
14
- k: H,
15
- l: J,
16
- u: K,
17
- m: O,
18
- b: Q,
19
- o: V,
20
- f: X,
21
- x: Y,
22
- y: Z,
23
- v: _
24
- };
25
- function $() {
26
- return /* @__PURE__ */ e.createElement("svg", { className: n.c, viewBox: "0 0 12 12", "aria-hidden": !0 }, /* @__PURE__ */ e.createElement(
27
- "path",
28
- {
29
- d: "M2.5 4.5 6 8l3.5-3.5",
30
- fill: "none",
31
- stroke: "currentColor",
32
- strokeWidth: "1.5",
33
- strokeLinecap: "round",
34
- strokeLinejoin: "round"
35
- }
36
- ));
37
- }
38
- function S() {
39
- return /* @__PURE__ */ e.createElement("svg", { className: n.m, viewBox: "0 0 12 12", "aria-hidden": !0 }, /* @__PURE__ */ e.createElement(
40
- "path",
41
- {
42
- d: "M4.5 2.5 8 6l-3.5 3.5",
43
- fill: "none",
44
- stroke: "currentColor",
45
- strokeWidth: "1.5",
46
- strokeLinecap: "round",
47
- strokeLinejoin: "round"
48
- }
49
- ));
50
- }
51
- function b({ className: t }) {
52
- return /* @__PURE__ */ e.createElement("svg", { className: s(n.v, t), viewBox: "0 0 12 12", "aria-hidden": !0 }, /* @__PURE__ */ e.createElement(
53
- "path",
54
- {
55
- d: "M2.5 6.2 4.8 8.5 9.5 3.5",
56
- fill: "none",
57
- stroke: "currentColor",
58
- strokeWidth: "1.8",
59
- strokeLinecap: "round",
60
- strokeLinejoin: "round"
61
- }
62
- ));
63
- }
64
- function ee({ item: t }) {
65
- return t.checkbox ? /* @__PURE__ */ e.createElement("span", { className: s(n.x, t.checked && n.y), "aria-hidden": !0 }, t.checked ? /* @__PURE__ */ e.createElement(b, null) : null) : t.checked ? /* @__PURE__ */ e.createElement("span", { className: n.k, "aria-hidden": !0 }, /* @__PURE__ */ e.createElement(b, null)) : t.status != null ? /* @__PURE__ */ e.createElement(
66
- "span",
67
- {
68
- className: s(n.b, t.status === "online" ? n.o : n.f),
69
- "aria-hidden": !0
70
- }
71
- ) : t.icon != null ? /* @__PURE__ */ e.createElement("span", { className: n.n }, t.icon) : null;
72
- }
73
- function ne(t, l, a) {
74
- return l != null && l.length > 0 ? a != null && l[0] && l[0].title == null ? [{ ...l[0], title: a }, ...l.slice(1)] : l : t != null && t.length > 0 ? [{ title: a, items: t }] : a != null ? [{ title: a, items: [] }] : [];
75
- }
76
- function le({
77
- items: t,
78
- groups: l,
79
- trigger: a,
80
- label: u,
81
- hideChevron: N = !1,
82
- title: x,
83
- align: f = "end",
84
- open: p,
85
- defaultOpen: y = !1,
86
- onOpenChange: d,
87
- closeOnSelect: L = !0,
88
- disabled: i = !1,
89
- onSelect: h,
90
- className: C
91
- }) {
92
- const [g, w] = e.useState(y), E = p !== void 0, k = E ? p : g, v = (r) => {
93
- E || w(r), d == null || d(r);
94
- }, B = ne(t, l, x), j = (r) => {
95
- var c;
96
- if (r.disabled) return;
97
- (c = r.onClick) == null || c.call(r), h == null || h(r.value, r), r.checkbox || r.submenu || !L || v(!1);
98
- }, D = a ?? /* @__PURE__ */ e.createElement(
99
- "button",
100
- {
101
- type: "button",
102
- className: n.t,
103
- "data-open": k ? "true" : void 0,
104
- disabled: i,
105
- "aria-haspopup": "menu",
106
- "aria-expanded": k
107
- },
108
- u,
109
- N ? null : /* @__PURE__ */ e.createElement($, null)
110
- );
111
- return /* @__PURE__ */ e.createElement(
112
- I,
113
- {
114
- className: s(n.r, C),
115
- open: k,
116
- onOpenChange: (r) => {
117
- i || v(r);
118
- },
119
- align: f,
120
- trigger: D,
121
- label: typeof u == "string" ? u : void 0,
122
- disabled: i
123
- },
124
- /* @__PURE__ */ e.createElement("div", { className: n.p, "data-align": f }, B.map((r, m) => /* @__PURE__ */ e.createElement(e.Fragment, { key: m }, m > 0 ? /* @__PURE__ */ e.createElement("hr", { className: n.d }) : null, /* @__PURE__ */ e.createElement("div", { className: n.g, role: "group" }, r.title != null ? /* @__PURE__ */ e.createElement("p", { className: n.h }, r.title) : null, r.items.map((c) => {
125
- const M = r.items.some(
126
- (o) => o.checked || o.checkbox || o.status != null || o.icon != null
127
- ), W = /* @__PURE__ */ e.createElement(ee, { item: c });
128
- return /* @__PURE__ */ e.createElement(
129
- "button",
130
- {
131
- key: c.value,
132
- type: "button",
133
- role: "menuitem",
134
- className: n.i,
135
- "data-checked": (c.checked || c.checkbox) && c.checked ? "true" : void 0,
136
- "data-danger": c.danger ? "true" : void 0,
137
- disabled: c.disabled,
138
- "aria-checked": c.checked != null || c.checkbox ? !!c.checked : void 0,
139
- onClick: () => j(c)
140
- },
141
- M ? W ?? /* @__PURE__ */ e.createElement("span", { className: n.n, "aria-hidden": !0 }) : null,
142
- c.label != null ? /* @__PURE__ */ e.createElement("span", { className: n.l }, c.label) : null,
143
- c.shortcut != null ? /* @__PURE__ */ e.createElement("span", { className: n.u }, c.shortcut) : null,
144
- c.submenu ? /* @__PURE__ */ e.createElement(S, null) : null
145
- );
146
- })))))
147
- );
148
- }
149
- export {
150
- le as D
151
- };
@@ -1,22 +0,0 @@
1
- import e from "react";
2
- import { c as s } from "./cx-CcykAxZN.js";
3
- import './Layout.css';const i = "clr", u = "clm", E = "cls", b = "clb", t = {
4
- r: i,
5
- m: u,
6
- s: E,
7
- b
8
- };
9
- function p({
10
- sidebar: c,
11
- header: a,
12
- footer: l,
13
- children: o,
14
- className: n,
15
- ...m
16
- }) {
17
- const r = /* @__PURE__ */ e.createElement(e.Fragment, null, a, /* @__PURE__ */ e.createElement("main", { className: t.m }, o), l);
18
- return c != null ? /* @__PURE__ */ e.createElement("div", { className: s(t.r, t.s, n), ...m }, c, /* @__PURE__ */ e.createElement("div", { className: t.b }, r)) : /* @__PURE__ */ e.createElement("div", { className: s(t.r, n), ...m }, r);
19
- }
20
- export {
21
- p as L
22
- };
@@ -1,15 +0,0 @@
1
- import c from "react";
2
- import { c as e } from "./cx-CcykAxZN.js";
3
- import './Loading.css';const s = "cgr", a = {
4
- r: s
5
- };
6
- function i({
7
- children: r = "Загрузка…",
8
- className: t,
9
- ...o
10
- }) {
11
- return /* @__PURE__ */ c.createElement("div", { className: e(a.r, t), role: "status", ...o }, r);
12
- }
13
- export {
14
- i as L
15
- };
@@ -1,58 +0,0 @@
1
- import l from "react";
2
- import { B as p } from "./Badge-jp-9iNNL.js";
3
- import { c as i } from "./cx-CcykAxZN.js";
4
- import './Menu.css';const b = "cmr", m = "cmv", k = "cmi", x = "cmd", E = "cma", g = "cmu", c = {
5
- r: b,
6
- v: m,
7
- i: k,
8
- d: x,
9
- a: E,
10
- u: g
11
- };
12
- function y(a) {
13
- if (a == null || a === "") return null;
14
- const r = Number(a);
15
- return !Number.isNaN(r) && r === 0 ? null : !Number.isNaN(r) && r > 99 ? "99+" : String(a);
16
- }
17
- function h({
18
- items: a,
19
- vertical: r,
20
- variant: v = "plain",
21
- value: o,
22
- onSelect: u,
23
- children: d,
24
- className: N,
25
- ...f
26
- }) {
27
- return /* @__PURE__ */ l.createElement(
28
- "nav",
29
- {
30
- className: i(c.r, r && c.v, v === "line" && c.u, N),
31
- ...f
32
- },
33
- a == null ? void 0 : a.map((n) => {
34
- const t = n.active ?? (o != null && n.value === o), s = y(n.badge);
35
- return /* @__PURE__ */ l.createElement(
36
- "button",
37
- {
38
- key: n.value,
39
- type: "button",
40
- className: i(c.i, t && c.a),
41
- "data-active": t ? "true" : void 0,
42
- "aria-current": t ? "page" : void 0,
43
- disabled: n.disabled,
44
- onClick: () => {
45
- var e;
46
- (e = n.onClick) == null || e.call(n), u == null || u(n.value);
47
- }
48
- },
49
- n.label,
50
- s != null ? /* @__PURE__ */ l.createElement(p, { className: c.d, tone: "accent", size: "s" }, s) : null
51
- );
52
- }),
53
- d
54
- );
55
- }
56
- export {
57
- h as M
58
- };
@@ -1,59 +0,0 @@
1
- import e, { useMemo as x, useState as I, Suspense as M } from "react";
2
- import { c as d } from "./cx-CcykAxZN.js";
3
- import './NavSections.css';const R = "cvr", j = "cvn", q = "cvg", w = "cvl", z = "cvi", A = "cva", B = "cvc", D = "cvt", F = "cvf", G = "cvm", t = {
4
- r: R,
5
- n: j,
6
- g: q,
7
- l: w,
8
- i: z,
9
- a: A,
10
- c: B,
11
- t: D,
12
- f: F,
13
- m: G
14
- };
15
- function H(l) {
16
- for (const r of l) {
17
- const n = r.items.find((s) => !s.disabled);
18
- if (n) return n.value;
19
- }
20
- return "";
21
- }
22
- function L({
23
- groups: l,
24
- resolveSection: r,
25
- value: n,
26
- defaultValue: s,
27
- onValueChange: i,
28
- loading: f = null,
29
- footer: v,
30
- className: b,
31
- navLabel: E = "Разделы"
32
- }) {
33
- const N = x(
34
- () => s || H(l),
35
- [s, l]
36
- ), [k, p] = I(N), m = n ?? k, y = (a) => {
37
- n == null && p(a), i == null || i(a);
38
- }, u = m ? r(m) : null;
39
- return /* @__PURE__ */ e.createElement("div", { className: d(t.r, b) }, /* @__PURE__ */ e.createElement("nav", { className: t.n, "aria-label": E }, l.map((a, S) => /* @__PURE__ */ e.createElement("div", { key: S, className: t.g }, a.label != null ? /* @__PURE__ */ e.createElement("div", { className: t.l }, a.label) : null, a.items.map((c) => {
40
- const o = c.value === m;
41
- return /* @__PURE__ */ e.createElement(
42
- "button",
43
- {
44
- key: c.value,
45
- type: "button",
46
- className: d(t.i, o && t.a),
47
- "data-active": o ? "true" : void 0,
48
- "aria-current": o ? "page" : void 0,
49
- disabled: c.disabled,
50
- onClick: () => y(c.value)
51
- },
52
- c.icon != null ? /* @__PURE__ */ e.createElement("span", { className: t.c, "aria-hidden": !0 }, c.icon) : null,
53
- /* @__PURE__ */ e.createElement("span", { className: t.t }, c.label)
54
- );
55
- }))), v != null ? /* @__PURE__ */ e.createElement("div", { className: t.f }, v) : null), /* @__PURE__ */ e.createElement("div", { className: t.m }, u ? /* @__PURE__ */ e.createElement(M, { fallback: f }, e.createElement(u)) : null));
56
- }
57
- export {
58
- L as N
59
- };
@@ -1,123 +0,0 @@
1
- import w, { useRef as h, useId as Q, useState as x, useLayoutEffect as S, useEffect as W } from "react";
2
- import { createPortal as V } from "react-dom";
3
- import { c as H } from "./cx-CcykAxZN.js";
4
- import './Popover.css';const N = 1e3, X = 10;
5
- function E() {
6
- const e = globalThis;
7
- return e.elcrm || (e.elcrm = {}), e.elcrm.overlayZ || (e.elcrm.overlayZ = { seq: 0, active: /* @__PURE__ */ new Set() }), e.elcrm.overlayZ;
8
- }
9
- function Y() {
10
- const e = E();
11
- e.seq += 1;
12
- const r = N + e.seq * X;
13
- return e.active.add(r), r;
14
- }
15
- function B(e) {
16
- const r = E();
17
- r.active.delete(e), r.active.size === 0 && (r.seq = 0);
18
- }
19
- function oe() {
20
- const e = E();
21
- return e.active.size === 0 ? N : Math.max(...e.active);
22
- }
23
- const _ = "c3r", $ = "c3t", C = "c3p", y = {
24
- r: _,
25
- t: $,
26
- p: C
27
- };
28
- function re({
29
- trigger: e,
30
- children: r,
31
- open: L,
32
- defaultOpen: D = !1,
33
- onOpenChange: m,
34
- align: M = "end",
35
- disabled: g = !1,
36
- label: O,
37
- role: T = "menu",
38
- className: A,
39
- panelClassName: F
40
- }) {
41
- const f = h(null), z = h(null), R = Q(), [K, U] = x(D), Z = L !== void 0, n = Z ? L : K, [c, I] = x(null), [i, P] = x(null), p = h(null);
42
- p.current = i;
43
- const v = (t) => {
44
- g && t || (Z || U(t), m == null || m(t));
45
- };
46
- S(() => {
47
- if (n) {
48
- i == null && P(Y());
49
- return;
50
- }
51
- i != null && (B(i), P(null));
52
- }, [n, i]), W(() => () => {
53
- p.current != null && B(p.current);
54
- }, []);
55
- const b = () => {
56
- const t = f.current;
57
- if (!t) return;
58
- const o = t.getBoundingClientRect(), s = 8, a = window.innerHeight - o.bottom - s - 8, l = o.top - s - 8, u = a >= 160 || a >= l, q = Math.min(420, Math.max(120, u ? a : l)), d = Math.max(200, o.width), G = u ? o.bottom + s : Math.max(8, o.top - s - q), J = M === "end" ? Math.max(8, Math.min(o.right - d, window.innerWidth - d - 8)) : Math.max(8, Math.min(o.left, window.innerWidth - d - 8));
59
- I({ top: G, left: J, minWidth: d, maxHeight: q });
60
- };
61
- S(() => {
62
- if (!n) {
63
- I(null);
64
- return;
65
- }
66
- b();
67
- const t = () => b();
68
- return window.addEventListener("resize", t), window.addEventListener("scroll", t, !0), () => {
69
- window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0);
70
- };
71
- }, [n, M]), W(() => {
72
- if (!n) return;
73
- const t = (s) => {
74
- var l, u;
75
- const a = s.target;
76
- (l = f.current) != null && l.contains(a) || (u = z.current) != null && u.contains(a) || v(!1);
77
- }, o = (s) => {
78
- s.key === "Escape" && v(!1);
79
- };
80
- return document.addEventListener("mousedown", t), document.addEventListener("keydown", o), () => {
81
- document.removeEventListener("mousedown", t), document.removeEventListener("keydown", o);
82
- };
83
- }, [n]);
84
- const j = c ? {
85
- position: "fixed",
86
- top: c.top,
87
- left: c.left,
88
- minWidth: c.minWidth,
89
- maxHeight: c.maxHeight,
90
- zIndex: i ?? 1e3
91
- } : void 0, k = n && c ? /* @__PURE__ */ w.createElement(
92
- "div",
93
- {
94
- ref: z,
95
- id: R,
96
- role: T,
97
- "aria-label": O,
98
- className: H(y.p, F),
99
- style: j,
100
- onMouseDown: (t) => t.stopPropagation()
101
- },
102
- r
103
- ) : null;
104
- return /* @__PURE__ */ w.createElement("div", { ref: f, className: H(y.r, A) }, /* @__PURE__ */ w.createElement(
105
- "div",
106
- {
107
- className: y.t,
108
- "aria-haspopup": "menu",
109
- "aria-expanded": n,
110
- "aria-controls": n ? R : void 0,
111
- onClick: () => {
112
- g || v(!n);
113
- }
114
- },
115
- e
116
- ), k && typeof document < "u" ? V(k, document.body) : null);
117
- }
118
- export {
119
- re as P,
120
- Y as a,
121
- oe as p,
122
- B as r
123
- };
@@ -1,126 +0,0 @@
1
- import e from "react";
2
- import { c as i } from "./cx-CcykAxZN.js";
3
- import './PricingGroup.css';const z = "cur", O = "cui", j = "cus", M = "cub", R = "cug", A = "cua", G = "cum", I = "cuh", K = "cut", T = "cup", U = "cuz", W = "cuo", $ = "cue", q = "cud", C = "cux", H = "cuf", J = "cuy", Q = "cul", X = "cuu", Y = "cun", Z = "cuc", _ = "cuk", V = "cuw", c = {
4
- r: z,
5
- i: O,
6
- s: j,
7
- b: M,
8
- g: R,
9
- a: A,
10
- m: G,
11
- h: I,
12
- t: K,
13
- p: T,
14
- z: U,
15
- o: W,
16
- e: $,
17
- d: q,
18
- x: C,
19
- f: H,
20
- y: J,
21
- l: Q,
22
- u: X,
23
- n: Y,
24
- c: Z,
25
- k: _,
26
- w: V
27
- };
28
- function N() {
29
- return /* @__PURE__ */ e.createElement("span", { className: c.k, "aria-hidden": !0 }, /* @__PURE__ */ e.createElement("svg", { className: c.w, viewBox: "0 0 12 12" }, /* @__PURE__ */ e.createElement(
30
- "path",
31
- {
32
- d: "M2.5 6.2 4.8 8.5 9.5 3.5",
33
- fill: "none",
34
- stroke: "currentColor",
35
- strokeWidth: "1.8",
36
- strokeLinecap: "round",
37
- strokeLinejoin: "round"
38
- }
39
- )));
40
- }
41
- function ee({ feature: l }) {
42
- if (l != null && typeof l == "object" && !e.isValidElement(l) && "label" in l) {
43
- const t = l;
44
- return /* @__PURE__ */ e.createElement("li", { className: c.c }, t.icon != null ? t.icon : /* @__PURE__ */ e.createElement(N, null), /* @__PURE__ */ e.createElement("span", null, t.label));
45
- }
46
- return /* @__PURE__ */ e.createElement("li", { className: c.c }, /* @__PURE__ */ e.createElement(N, null), /* @__PURE__ */ e.createElement("span", null, l));
47
- }
48
- function h({ item: l }) {
49
- const t = l.badge != null && (l.badgePlacement ?? "pill") === "pill";
50
- return l.title == null && !t ? null : /* @__PURE__ */ e.createElement("div", { className: c.h }, l.title != null ? /* @__PURE__ */ e.createElement("h3", { className: c.t }, l.title) : null, t ? /* @__PURE__ */ e.createElement("span", { className: c.g }, l.badge) : null);
51
- }
52
- function k({ item: l }) {
53
- return l.price == null && l.priceOld == null && l.meta == null ? null : /* @__PURE__ */ e.createElement("div", { className: c.p }, l.priceOld != null ? /* @__PURE__ */ e.createElement("span", { className: c.o }, l.priceOld) : null, l.price != null ? /* @__PURE__ */ e.createElement("span", { className: c.z }, l.price) : null, l.meta != null ? /* @__PURE__ */ e.createElement("span", { className: c.e }, l.meta) : null);
54
- }
55
- function d({ item: l }) {
56
- return l.description == null ? null : /* @__PURE__ */ e.createElement("p", { className: c.d }, l.description);
57
- }
58
- function le({
59
- actions: l,
60
- placement: t
61
- }) {
62
- return /* @__PURE__ */ e.createElement(
63
- "div",
64
- {
65
- className: t === "footer" ? c.f : c.x,
66
- onClick: (a) => a.stopPropagation(),
67
- onMouseDown: (a) => a.preventDefault()
68
- },
69
- l
70
- );
71
- }
72
- function ne({ item: l }) {
73
- return l.features == null && l.featuresLabel == null && l.featuresSummary == null ? null : /* @__PURE__ */ e.createElement("div", { className: c.y }, l.featuresLabel != null ? /* @__PURE__ */ e.createElement("p", { className: c.l }, l.featuresLabel) : null, l.featuresSummary != null ? /* @__PURE__ */ e.createElement("p", { className: c.u }, l.featuresSummary) : null, l.features != null && l.features.length > 0 ? /* @__PURE__ */ e.createElement("ul", { className: c.n }, l.features.map((t, a) => /* @__PURE__ */ e.createElement(ee, { key: a, feature: t }))) : null);
74
- }
75
- function ae({
76
- items: l,
77
- value: t,
78
- defaultValue: a,
79
- selectable: y = !1,
80
- disabled: P = !1,
81
- onValueChange: u,
82
- className: w,
83
- ...x
84
- }) {
85
- const [B, D] = e.useState(a), m = t !== void 0, F = m ? t : B, f = (n) => {
86
- m || D(n), u == null || u(n);
87
- };
88
- return /* @__PURE__ */ e.createElement("div", { className: i(c.r, w), role: "list", ...x }, l.map((n) => {
89
- const p = F === n.value, E = P || !!n.disabled, L = !!n.highlighted || p, b = n.badgePlacement ?? "pill", r = n.actionsPlacement ?? "after", g = n.descriptionPlacement ?? "after-price", s = y && !E, v = n.actions != null ? /* @__PURE__ */ e.createElement(
90
- le,
91
- {
92
- actions: n.actions,
93
- placement: r
94
- }
95
- ) : null, S = /* @__PURE__ */ e.createElement(e.Fragment, null, n.priceFirst ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(k, { item: n }), /* @__PURE__ */ e.createElement(h, { item: n }), /* @__PURE__ */ e.createElement(d, { item: n })) : /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(h, { item: n }), g === "before-price" ? /* @__PURE__ */ e.createElement(d, { item: n }) : null, /* @__PURE__ */ e.createElement(k, { item: n }), g === "after-price" ? /* @__PURE__ */ e.createElement(d, { item: n }) : null));
96
- return /* @__PURE__ */ e.createElement(
97
- "div",
98
- {
99
- key: n.value,
100
- role: "listitem",
101
- className: i(c.i, L && c.s),
102
- "data-selected": p ? "true" : void 0,
103
- "data-highlighted": n.highlighted ? "true" : void 0,
104
- "data-selectable": s ? "true" : void 0,
105
- "aria-disabled": E || void 0,
106
- tabIndex: s ? 0 : void 0,
107
- onClick: () => {
108
- s && f(n.value);
109
- },
110
- onKeyDown: (o) => {
111
- s && (o.key === "Enter" || o.key === " ") && (o.preventDefault(), f(n.value));
112
- }
113
- },
114
- n.badge != null && b === "banner" ? /* @__PURE__ */ e.createElement("div", { className: c.b }, n.badge) : null,
115
- n.badge != null && b === "float" ? /* @__PURE__ */ e.createElement("div", { className: i(c.g, c.a) }, n.badge) : null,
116
- n.icon != null ? /* @__PURE__ */ e.createElement("div", { className: c.m }, n.icon) : null,
117
- S,
118
- r === "before" ? v : null,
119
- /* @__PURE__ */ e.createElement(ne, { item: n }),
120
- r === "after" || r === "footer" ? v : null
121
- );
122
- }));
123
- }
124
- export {
125
- ae as P
126
- };