@elcrm/components 0.2.13 → 0.5.1
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 +76 -38
- package/dist/ActionGroup-DcApj_Mz.js +27 -0
- package/dist/ActionGroup.css +1 -1
- package/dist/ActionGroup.d.ts +19 -19
- package/dist/ActionGroup.js +1 -1
- package/dist/Avatar-eGdLrMCv.js +113 -0
- package/dist/Avatar.css +1 -1
- package/dist/Avatar.d.ts +4 -4
- package/dist/Avatar.js +1 -1
- package/dist/AvatarGroup-Dq-UrOaC.js +81 -0
- package/dist/AvatarGroup.css +1 -1
- package/dist/AvatarGroup.d.ts +8 -28
- package/dist/AvatarGroup.js +1 -1
- package/dist/AvatarName-3B4yCxHn.js +68 -0
- package/dist/AvatarName.css +1 -1
- package/dist/AvatarName.js +1 -1
- package/dist/Badge-BjScAXGy.js +28 -0
- package/dist/Badge.css +1 -1
- package/dist/Badge.js +1 -1
- package/dist/Banner-DAY18FWO.js +34 -0
- package/dist/Banner.css +1 -1
- package/dist/Banner.js +1 -1
- package/dist/Brand-BfCuiyf7.js +34 -0
- package/dist/Brand.css +1 -1
- package/dist/Brand.d.ts +8 -10
- package/dist/Brand.js +1 -1
- package/dist/Breadcrumb-DM_hWw5n.js +98 -0
- package/dist/Breadcrumb.css +1 -1
- package/dist/Breadcrumb.d.ts +8 -5
- package/dist/Breadcrumb.js +1 -1
- package/dist/Card-a7N8Uh_H.js +12 -0
- package/dist/Card.css +1 -1
- package/dist/Card.js +1 -1
- package/dist/ChatFrame-BdSYRF-B.js +37 -0
- package/dist/ChatFrame.css +1 -1
- package/dist/ChatList.js +2 -2
- package/dist/{ChatMessages-B8rdXiK-.js → ChatMessages-CLxwRGIa.js} +1 -1
- package/dist/ChatMessages.js +1 -1
- package/dist/ChatSplit-8iw_1Shp.js +21 -0
- package/dist/CodeBlock-B3wvMejv.js +34 -0
- package/dist/CodeBlock.css +1 -1
- package/dist/CodeBlock.js +1 -1
- package/dist/Dropdown-CR_XxNak.js +185 -0
- package/dist/Dropdown.css +1 -1
- package/dist/Dropdown.d.ts +4 -94
- package/dist/Dropdown.js +1 -1
- package/dist/EmptyState-B_wWPjUu.js +23 -0
- package/dist/EmptyState.css +1 -1
- package/dist/EmptyState.d.ts +1 -1
- package/dist/EmptyState.js +1 -1
- package/dist/{Footer-qxUlnPR9.js → Footer-Bgh_JCUe.js} +4 -4
- package/dist/Footer.css +1 -1
- package/dist/Footer.js +1 -1
- package/dist/Header-BMDIi3u2.js +21 -0
- package/dist/Header.css +1 -1
- package/dist/Header.js +1 -1
- package/dist/Healthmap-Z-LLfGW0.js +359 -0
- package/dist/Healthmap.css +1 -1
- package/dist/Healthmap.d.ts +25 -3
- package/dist/Healthmap.js +1 -1
- package/dist/{Item-D4okhsfW.js → Item-CGpkMJu0.js} +13 -13
- package/dist/Item.css +1 -1
- package/dist/Item.d.ts +7 -7
- package/dist/Item.js +1 -1
- package/dist/ItemColumn-Ch61LqE0.js +41 -0
- package/dist/ItemColumn.css +1 -1
- package/dist/ItemColumn.js +1 -1
- package/dist/Layout-CzEGKl9s.js +31 -0
- package/dist/Layout.css +1 -1
- package/dist/Layout.d.ts +1 -1
- package/dist/Layout.js +1 -1
- package/dist/List-D13pqaUY.js +12 -0
- package/dist/List.css +1 -1
- package/dist/List.js +1 -1
- package/dist/Loading-C_CKD-zt.js +16 -0
- package/dist/Loading.css +1 -1
- package/dist/Loading.d.ts +1 -1
- package/dist/Loading.js +1 -1
- package/dist/Menu-D2kf7fN_.js +72 -0
- package/dist/Menu.css +1 -1
- package/dist/Menu.d.ts +7 -25
- package/dist/Menu.js +1 -1
- package/dist/NavSections-CNxxBMPT.js +154 -0
- package/dist/NavSections.css +1 -1
- package/dist/NavSections.d.ts +16 -28
- package/dist/NavSections.js +1 -1
- package/dist/PageHead-BfClTLrF.js +31 -0
- package/dist/PageHead.css +1 -1
- package/dist/PageHead.d.ts +1 -1
- package/dist/PageHead.js +1 -1
- package/dist/PageShell-BAJges-G.js +30 -0
- package/dist/PageShell.css +1 -1
- package/dist/PageShell.js +1 -1
- package/dist/PanelInfo-Db5GCr-c.js +137 -0
- package/dist/PanelInfo.css +1 -1
- package/dist/PanelInfo.d.ts +16 -9
- package/dist/PanelInfo.js +1 -1
- package/dist/Popover-xEZoMY-h.js +143 -0
- package/dist/Popover.css +1 -1
- package/dist/Popover.d.ts +40 -11
- package/dist/Popover.js +1 -1
- package/dist/PricingGroup-CWy47MlE.js +138 -0
- package/dist/PricingGroup.css +1 -1
- package/dist/PricingGroup.d.ts +0 -2
- package/dist/PricingGroup.js +1 -1
- package/dist/PricingTable-BjpGVAhi.js +157 -0
- package/dist/PricingTable.css +1 -1
- package/dist/PricingTable.d.ts +4 -7
- package/dist/PricingTable.js +1 -1
- package/dist/RadioGroup-DI4KKUvZ.js +121 -0
- package/dist/RadioGroup.css +1 -1
- package/dist/RadioGroup.js +1 -1
- package/dist/Section-PprWjOvt.js +47 -0
- package/dist/Section.css +1 -1
- package/dist/Section.d.ts +29 -9
- package/dist/Section.js +1 -1
- package/dist/Sidebar-Bouhd5SS.js +205 -0
- package/dist/Sidebar.css +1 -1
- package/dist/Sidebar.d.ts +18 -26
- package/dist/Sidebar.js +1 -1
- package/dist/SplitPane-DBa-g9td.js +92 -0
- package/dist/SplitPane.css +1 -1
- package/dist/SplitPane.d.ts +8 -7
- package/dist/SplitPane.js +1 -1
- package/dist/Stack-BPTehVYc.js +53 -0
- package/dist/Stack.css +1 -1
- package/dist/Stack.d.ts +2 -1
- package/dist/Stack.js +1 -1
- package/dist/Stat-p8j4PjrC.js +28 -0
- package/dist/Stat.css +1 -1
- package/dist/Stat.js +1 -1
- package/dist/TabSections-Dppe9wiz.js +84 -0
- package/dist/TabSections.css +1 -1
- package/dist/TabSections.d.ts +7 -2
- package/dist/TabSections.js +1 -1
- package/dist/Table-DqrDUUtb.js +27 -0
- package/dist/Table.css +1 -1
- package/dist/Table.d.ts +10 -2
- package/dist/Table.js +1 -1
- package/dist/Text-Bo1u7gVC.js +25 -0
- package/dist/Text.css +1 -0
- package/dist/Text.d.ts +19 -0
- package/dist/Text.js +4 -0
- package/dist/TextGroup-236jHxdT.js +23 -0
- package/dist/TextGroup.css +1 -1
- package/dist/TextGroup.js +1 -1
- package/dist/Toolbar-Bl9-5Mis.js +35 -0
- package/dist/Toolbar.css +1 -1
- package/dist/Toolbar.d.ts +7 -12
- package/dist/Toolbar.js +1 -2
- package/dist/cx.d.ts +1 -1
- package/dist/dark.css +12 -0
- package/dist/index.css +41 -39
- package/dist/index.d.ts +7 -12
- package/dist/index.es.d.ts +7 -12
- package/dist/index.es.js +110 -107
- package/dist/kit-manifest.json +1646 -0
- package/dist/lazyRoute.d.ts +12 -6
- package/dist/light.css +12 -0
- package/dist/navTree.d.ts +13 -1
- package/dist/rovingKeys-Di9N1Nct.js +23 -0
- package/dist/rovingKeys.d.ts +7 -1
- package/dist/stackGap.d.ts +1 -1
- package/dist/tokens.css +20 -2
- package/dist/useControllableValue-BaE0VR5d.js +13 -0
- package/dist/useControllableValue.d.ts +3 -0
- package/package.json +48 -4
- package/dist/ActionGroup-ChKFW0mt.js +0 -27
- package/dist/Avatar-loGgFt72.js +0 -113
- package/dist/AvatarGroup-D1gnT3Od.js +0 -81
- package/dist/AvatarName-0BzyfpMq.js +0 -68
- package/dist/Badge-jp-9iNNL.js +0 -28
- package/dist/Banner-B72lcEMo.js +0 -34
- package/dist/Block-Bu7NEA0g.js +0 -8
- package/dist/Block.d.ts +0 -30
- package/dist/Block.js +0 -4
- package/dist/Brand-Zq-Idks4.js +0 -34
- package/dist/Breadcrumb-CAM_e9LN.js +0 -98
- package/dist/Card-hn37Opo3.js +0 -12
- package/dist/ChatFrame-BW2TmCkZ.js +0 -37
- package/dist/ChatSplit-DNnu3TNq.js +0 -21
- package/dist/CodeBlock-CRzVopIv.js +0 -25
- package/dist/Column-BiogBDf8.js +0 -8
- package/dist/Column.d.ts +0 -24
- package/dist/Column.js +0 -4
- package/dist/Dropdown-DosvDR13.js +0 -147
- package/dist/EmptyState-mBiWtMIM.js +0 -23
- package/dist/Header-DZQopVNy.js +0 -21
- package/dist/Healthmap-B6cdiLUl.js +0 -243
- package/dist/ItemColumn-M7a9L8CI.js +0 -41
- package/dist/Layout-mi6Ghayv.js +0 -31
- package/dist/List-BgKkYaGO.js +0 -12
- package/dist/Loading-DkkG7RcE.js +0 -16
- package/dist/Menu-DuXQv-zT.js +0 -66
- package/dist/NavSections-D6rDEtT1.js +0 -142
- package/dist/PageHead-DgaJ1mXY.js +0 -31
- package/dist/PageShell-D9EZiO8o.js +0 -30
- package/dist/PanelInfo-A5y5ysH8.js +0 -81
- package/dist/Popover-DWdvZTuA.js +0 -135
- package/dist/PricingGroup-Czuhe81Z.js +0 -120
- package/dist/PricingTable-BuLC0opK.js +0 -152
- package/dist/RadioGroup-fcXzhvMu.js +0 -129
- package/dist/Row-DsQOVn18.js +0 -8
- package/dist/Row.d.ts +0 -24
- package/dist/Row.js +0 -4
- package/dist/Section-Crxk2J-E.js +0 -34
- package/dist/Sidebar-CYFaPqdC.js +0 -178
- package/dist/SplitPane-DR7PCZ8f.js +0 -74
- package/dist/Stack-XkmPSswj.js +0 -53
- package/dist/Stat-sKXJwz5L.js +0 -27
- package/dist/TabSections-DN7yVJoF.js +0 -69
- package/dist/Table-BoDr3X2d.js +0 -25
- package/dist/TextGroup-DmhuyMR1.js +0 -23
- package/dist/Toolbar-C1zAk9ak.js +0 -42
- package/dist/rovingKeys-CGlfTtNQ.js +0 -15
- package/dist/useControllableValue-CWqH1kpM.js +0 -10
package/dist/lazyRoute.d.ts
CHANGED
|
@@ -3,14 +3,18 @@ import { ComponentType, LazyExoticComponent } from 'react';
|
|
|
3
3
|
* Lazy-компонент секции для {@link NavSections} / {@link TabSections}.
|
|
4
4
|
*/
|
|
5
5
|
export type LazyRouteChunk = LazyExoticComponent<ComponentType<Record<string, unknown>>>;
|
|
6
|
+
/**
|
|
7
|
+
* Резолвер секций: `(segment) => lazy` + `clear` для сброса кэша / retry.
|
|
8
|
+
*/
|
|
9
|
+
export type LazyResolver = ((segment: string) => LazyRouteChunk) & {
|
|
10
|
+
/** Сбросить кэш: один сегмент или весь. Следующий вызов снова вызовет `load`. */
|
|
11
|
+
clear: (segment?: string) => void;
|
|
12
|
+
};
|
|
6
13
|
/**
|
|
7
14
|
* Кэш lazy-чанков: один `lazy()` на сегмент (иначе remount при каждом рендере).
|
|
8
15
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @param load — функция загрузки модуля по сегменту (`value` пункта меню/вкладки).
|
|
13
|
-
* @returns резолвер `(segment) => LazyRouteChunk`.
|
|
16
|
+
* При ошибке загрузки слот сбрасывается — повторный mount может retry.
|
|
17
|
+
* Явный сброс: `resolve.clear()` / `resolve.clear("intro")`.
|
|
14
18
|
*
|
|
15
19
|
* @example
|
|
16
20
|
* ```tsx
|
|
@@ -19,8 +23,10 @@ export type LazyRouteChunk = LazyExoticComponent<ComponentType<Record<string, un
|
|
|
19
23
|
* );
|
|
20
24
|
*
|
|
21
25
|
* <NavSections groups={groups} resolveSection={resolveSection} />
|
|
26
|
+
* // после падения чанка:
|
|
27
|
+
* resolveSection.clear("intro");
|
|
22
28
|
* ```
|
|
23
29
|
*/
|
|
24
30
|
export declare function createLazyResolver(load: (segment: string) => Promise<{
|
|
25
31
|
default: ComponentType<Record<string, unknown>>;
|
|
26
|
-
}>):
|
|
32
|
+
}>): LazyResolver;
|
package/dist/light.css
CHANGED
|
@@ -24,6 +24,18 @@ body[data-theme="light"] {
|
|
|
24
24
|
--sidebar-item-active: var(--shell-color);
|
|
25
25
|
--sidebar-item-active-bg: var(--shell-background-selected);
|
|
26
26
|
--sidebar-icon-active: var(--shell-color-accent);
|
|
27
|
+
/* панель аккаунта — цвета текущей темы */
|
|
28
|
+
--sidebar-account-menu-bg: var(--shell-background);
|
|
29
|
+
--sidebar-account-menu-color: var(--shell-color);
|
|
30
|
+
--sidebar-account-menu-border: var(--shell-border);
|
|
31
|
+
--sidebar-account-menu-shadow: var(--popup-shadow, var(--shell-shadow));
|
|
32
|
+
--sidebar-account-item-hover: var(--shell-background-hover);
|
|
33
|
+
--sidebar-account-item-icon: var(--shell-color-muted);
|
|
34
|
+
--sidebar-account-danger-hover: color-mix(
|
|
35
|
+
in srgb,
|
|
36
|
+
var(--shell-color-danger) 12%,
|
|
37
|
+
transparent
|
|
38
|
+
);
|
|
27
39
|
|
|
28
40
|
--avatar-background: var(--shell-color-accent);
|
|
29
41
|
--avatar-color: var(--button-primary-fg);
|
package/dist/navTree.d.ts
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Общий узел дерева меню (Sidebar / NavSections).
|
|
4
|
+
* Расширяйте полями (`badge`, …), не дублируйте `value` / `items` / `defaultOpen`.
|
|
5
|
+
*/
|
|
2
6
|
export type NavTreeNode = {
|
|
3
7
|
value: string;
|
|
4
8
|
items?: NavTreeNode[];
|
|
5
9
|
defaultOpen?: boolean;
|
|
6
10
|
disabled?: boolean;
|
|
7
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Узел с подписью и опциональной иконкой — канон для Sidebar / NavSections.
|
|
14
|
+
*/
|
|
15
|
+
export type NavTreeItem = NavTreeNode & {
|
|
16
|
+
label: ReactNode;
|
|
17
|
+
icon?: ReactNode;
|
|
18
|
+
items?: NavTreeItem[];
|
|
19
|
+
};
|
|
8
20
|
export declare function walkNavTree<T extends NavTreeNode>(items: T[] | undefined, fn: (item: T, ancestors: string[]) => void, ancestors?: string[]): void;
|
|
9
21
|
export declare function walkNavGroups<T extends NavTreeNode>(groups: {
|
|
10
22
|
items?: T[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function d(e) {
|
|
2
|
+
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
3
|
+
}
|
|
4
|
+
function g(e, { values: n, value: c, onSelect: l, vertical: f, focusRoot: o }) {
|
|
5
|
+
if (n.length === 0) return;
|
|
6
|
+
const p = f ? "ArrowUp" : "ArrowLeft", i = f ? "ArrowDown" : "ArrowRight";
|
|
7
|
+
let t;
|
|
8
|
+
if (e.key === "Home") t = n[0];
|
|
9
|
+
else if (e.key === "End") t = n[n.length - 1];
|
|
10
|
+
else if (e.key === p || e.key === i) {
|
|
11
|
+
const r = Math.max(0, n.indexOf(c ?? "")), y = e.key === i ? 1 : -1;
|
|
12
|
+
t = n[(r + y + n.length) % n.length];
|
|
13
|
+
} else return;
|
|
14
|
+
if (t != null && (e.preventDefault(), l(t), o)) {
|
|
15
|
+
const r = o.querySelector(
|
|
16
|
+
`[data-value="${d(t)}"]`
|
|
17
|
+
);
|
|
18
|
+
r instanceof HTMLElement && r.focus();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
g as h
|
|
23
|
+
};
|
package/dist/rovingKeys.d.ts
CHANGED
|
@@ -5,9 +5,15 @@ type Opts = {
|
|
|
5
5
|
onSelect: (value: string) => void;
|
|
6
6
|
/** `true` — стрелки вверх/вниз, иначе влево/вправо */
|
|
7
7
|
vertical?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Корень для переноса фокуса на `[data-value="…"]`.
|
|
10
|
+
* Без него меняется только выбранное значение (как раньше).
|
|
11
|
+
*/
|
|
12
|
+
focusRoot?: ParentNode | null;
|
|
8
13
|
};
|
|
9
14
|
/**
|
|
10
15
|
* Перемещение выбора по списку `value` (меню, вкладки).
|
|
16
|
+
* При `focusRoot` ещё и фокусирует элемент с `data-value`.
|
|
11
17
|
*/
|
|
12
|
-
export declare function handleRovingKeys(event: KeyboardEvent, { values, value, onSelect, vertical }: Opts): void;
|
|
18
|
+
export declare function handleRovingKeys(event: KeyboardEvent, { values, value, onSelect, vertical, focusRoot }: Opts): void;
|
|
13
19
|
export {};
|
package/dist/stackGap.d.ts
CHANGED
package/dist/tokens.css
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
--shell-font-size: var(--control-font-size);
|
|
13
13
|
--shell-font-size-sm: 13px;
|
|
14
14
|
--shell-font-size-lg: 18px;
|
|
15
|
+
--control-font-size-s: 0.8125rem;
|
|
15
16
|
--shell-font-weight: 600;
|
|
16
17
|
--shell-gap: 12px;
|
|
17
18
|
--shell-gap-sm: 8px;
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
--header-height: 52px;
|
|
42
43
|
--header-shadow: none;
|
|
43
44
|
--header-margin: 0;
|
|
44
|
-
--header-z:
|
|
45
|
+
--header-z: 30;
|
|
45
46
|
/* shorthand: толщина + стиль + цвет, все стороны. Только снизу — `none` и линия через --header-shadow */
|
|
46
47
|
--header-border: 1px solid var(--shell-border);
|
|
47
48
|
/* выравнивание nav в оставшейся ширине шапки: flex-start | center | flex-end */
|
|
@@ -103,17 +104,27 @@
|
|
|
103
104
|
--item-column-icon-radius: var(--avatar-radius);
|
|
104
105
|
--item-column-title-size: var(--shell-font-size);
|
|
105
106
|
--item-column-title-line: 1.3;
|
|
107
|
+
--item-column-meta-size: var(--shell-font-size-sm);
|
|
106
108
|
|
|
107
109
|
/* —— sidebar —— */
|
|
108
110
|
--sidebar-width: 248px;
|
|
109
111
|
--sidebar-pad-x: var(--shell-gap);
|
|
110
112
|
--sidebar-pad-y: var(--shell-gap-lg);
|
|
111
|
-
--sidebar-block-radius:
|
|
113
|
+
--sidebar-block-radius: 14px;
|
|
112
114
|
--sidebar-item-font-size: var(--shell-font-size-sm);
|
|
113
115
|
--sidebar-item-padding: 6px 10px;
|
|
114
116
|
--sidebar-icon-size: 16px;
|
|
115
117
|
--sidebar-group-font-size: 11px;
|
|
116
118
|
--sidebar-indent: 14px;
|
|
119
|
+
/* меню аккаунта (футер Sidebar, как elWMS SidebarUserMenu) */
|
|
120
|
+
--sidebar-account-chip-radius: 14px;
|
|
121
|
+
--sidebar-account-chip-padding: 8px;
|
|
122
|
+
--sidebar-account-chip-gap: 10px;
|
|
123
|
+
--sidebar-account-menu-radius: 18px;
|
|
124
|
+
--sidebar-account-menu-padding: 6px;
|
|
125
|
+
--sidebar-account-item-radius: 12px;
|
|
126
|
+
--sidebar-account-item-padding: 10px 12px;
|
|
127
|
+
--sidebar-account-item-gap: 12px;
|
|
117
128
|
|
|
118
129
|
/* —— chat —— */
|
|
119
130
|
--chat-list-width: 340px;
|
|
@@ -131,6 +142,8 @@
|
|
|
131
142
|
--table-cell-padding: 0.55rem 0.7rem;
|
|
132
143
|
--table-head-font-size: 0.75rem;
|
|
133
144
|
--table-code-font-size: 0.8rem;
|
|
145
|
+
--table-head-background: var(--shell-background);
|
|
146
|
+
--table-max-height: none;
|
|
134
147
|
|
|
135
148
|
/* —— code-block —— */
|
|
136
149
|
--code-block-bg: var(--shell-background);
|
|
@@ -153,4 +166,9 @@
|
|
|
153
166
|
--banner-padding: 0.55rem 0.85rem;
|
|
154
167
|
--banner-bg: color-mix(in srgb, var(--shell-color-accent) 8%, var(--shell-bg));
|
|
155
168
|
--banner-border: color-mix(in srgb, var(--shell-color-accent) 35%, var(--shell-border));
|
|
169
|
+
|
|
170
|
+
/* —— loading / empty —— */
|
|
171
|
+
--loading-min-height: min(50vh, 24rem);
|
|
172
|
+
--empty-max-width: 36rem;
|
|
173
|
+
--empty-padding: 2rem;
|
|
156
174
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useState as d, useRef as i } from "react";
|
|
2
|
+
function V(r, s, o) {
|
|
3
|
+
var n;
|
|
4
|
+
const [c, u] = d(s), e = r !== void 0, t = i(e);
|
|
5
|
+
return typeof process < "u" && ((n = process.env) == null ? void 0 : n.NODE_ENV) !== "production" && t.current !== e && console.warn(
|
|
6
|
+
"[@elcrm/components] useControllableValue: не переключайте controlled ↔ uncontrolled (value то undefined, то задан)."
|
|
7
|
+
), t.current = e, [e ? r : c, (l) => {
|
|
8
|
+
e || u(l), o == null || o(l);
|
|
9
|
+
}];
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
V as u
|
|
13
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Controlled / uncontrolled значение (как `value` + `defaultValue` у групп).
|
|
3
|
+
*
|
|
4
|
+
* Не переключайте режим в рантайме (`value` то `undefined`, то задан) —
|
|
5
|
+
* в dev будет предупреждение.
|
|
3
6
|
*/
|
|
4
7
|
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.
|
|
3
|
+
"version": "0.5.1",
|
|
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>",
|
|
@@ -84,17 +84,61 @@
|
|
|
84
84
|
},
|
|
85
85
|
"./package.json": "./package.json"
|
|
86
86
|
},
|
|
87
|
+
"scripts": {
|
|
88
|
+
"dev": "vite --config test/vite.config.ts",
|
|
89
|
+
"build": "vite build",
|
|
90
|
+
"postbuild": "node scripts/postbuild.mjs",
|
|
91
|
+
"check:css": "node scripts/check-css-scoped.mjs",
|
|
92
|
+
"check:tokens": "node scripts/check-tokens.mjs",
|
|
93
|
+
"test": "vitest run",
|
|
94
|
+
"test:build": "vite build --config test/vite.config.ts",
|
|
95
|
+
"test:preview": "vite preview --config test/vite.config.ts",
|
|
96
|
+
"prepublishOnly": "npm run check:css && npm run check:tokens && npm run test && npm run build",
|
|
97
|
+
"prepack": "node scripts/publish-manifest.mjs pack",
|
|
98
|
+
"postpack": "node scripts/publish-manifest.mjs restore",
|
|
99
|
+
"manifest:public": "node scripts/publish-manifest.mjs write",
|
|
100
|
+
"pack:temp": "node scripts/publish-manifest.mjs pack-temp",
|
|
101
|
+
"pack:check": "npm pack --dry-run"
|
|
102
|
+
},
|
|
87
103
|
"peerDependencies": {
|
|
88
|
-
"@elcrm/button": "1.2.0",
|
|
89
|
-
"@elcrm/icons": "0.1.5",
|
|
90
|
-
"@elcrm/tooltip": "0.1.2",
|
|
104
|
+
"@elcrm/button": "^1.2.0",
|
|
105
|
+
"@elcrm/icons": "^0.1.5",
|
|
106
|
+
"@elcrm/tooltip": "^0.1.2",
|
|
91
107
|
"@types/react": ">=18.0.0",
|
|
92
108
|
"react": ">=18.0.0",
|
|
93
109
|
"react-dom": ">=18.0.0"
|
|
94
110
|
},
|
|
95
111
|
"peerDependenciesMeta": {
|
|
112
|
+
"@elcrm/button": {
|
|
113
|
+
"optional": true
|
|
114
|
+
},
|
|
115
|
+
"@elcrm/icons": {
|
|
116
|
+
"optional": true
|
|
117
|
+
},
|
|
118
|
+
"@elcrm/tooltip": {
|
|
119
|
+
"optional": true
|
|
120
|
+
},
|
|
96
121
|
"@types/react": {
|
|
97
122
|
"optional": true
|
|
98
123
|
}
|
|
124
|
+
},
|
|
125
|
+
"devDependencies": {
|
|
126
|
+
"@elcrm/button": "^1.2.0",
|
|
127
|
+
"@elcrm/icons": "^0.1.5",
|
|
128
|
+
"@elcrm/tooltip": "^0.1.2",
|
|
129
|
+
"@testing-library/react": "^16.2.0",
|
|
130
|
+
"@types/node": "^22.13.10",
|
|
131
|
+
"@types/react": "^18.2.66",
|
|
132
|
+
"@types/react-dom": "^18.2.22",
|
|
133
|
+
"@vitejs/plugin-react": "^4.3.1",
|
|
134
|
+
"elcrm": "file:../elCRM.cli",
|
|
135
|
+
"jsdom": "^26.0.0",
|
|
136
|
+
"react": "^18.2.0",
|
|
137
|
+
"react-dom": "^18.2.0",
|
|
138
|
+
"typescript": "^5.8.2",
|
|
139
|
+
"vite": "^5.4.2",
|
|
140
|
+
"vite-plugin-dts": "^4.0.3",
|
|
141
|
+
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
142
|
+
"vitest": "^3.0.8"
|
|
99
143
|
}
|
|
100
144
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import e from "react";
|
|
2
|
-
import { c as n } from "./cx-CcykAxZN.js";
|
|
3
|
-
import './ActionGroup.css';const s = "c5r", i = {
|
|
4
|
-
r: s
|
|
5
|
-
};
|
|
6
|
-
function p({
|
|
7
|
-
label: r,
|
|
8
|
-
items: o,
|
|
9
|
-
children: t,
|
|
10
|
-
className: a,
|
|
11
|
-
...c
|
|
12
|
-
}) {
|
|
13
|
-
return /* @__PURE__ */ e.createElement(
|
|
14
|
-
"div",
|
|
15
|
-
{
|
|
16
|
-
className: n(i.r, a),
|
|
17
|
-
role: "toolbar",
|
|
18
|
-
"aria-label": r,
|
|
19
|
-
...c
|
|
20
|
-
},
|
|
21
|
-
o,
|
|
22
|
-
t
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
export {
|
|
26
|
-
p as A
|
|
27
|
-
};
|
package/dist/Avatar-loGgFt72.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import a from "react";
|
|
2
|
-
import { c as p } from "./cx-CcykAxZN.js";
|
|
3
|
-
import './Avatar.css';const h = "car", x = "cav", A = "cas", C = "cam", S = "cal", z = "caa", B = "cai", F = "cab", R = "cao", U = "caf", e = {
|
|
4
|
-
r: h,
|
|
5
|
-
v: x,
|
|
6
|
-
s: A,
|
|
7
|
-
m: C,
|
|
8
|
-
l: S,
|
|
9
|
-
a: z,
|
|
10
|
-
i: B,
|
|
11
|
-
b: F,
|
|
12
|
-
o: R,
|
|
13
|
-
f: U
|
|
14
|
-
};
|
|
15
|
-
function $(t) {
|
|
16
|
-
const n = t.trim();
|
|
17
|
-
if (!n) return "?";
|
|
18
|
-
const s = n.split(/\s+/).filter(Boolean);
|
|
19
|
-
return s.length >= 2 ? (s[0][0] + s[1][0]).toUpperCase() : n.slice(0, 2).toUpperCase();
|
|
20
|
-
}
|
|
21
|
-
function D(t) {
|
|
22
|
-
if (!(t == null || t === ""))
|
|
23
|
-
return {
|
|
24
|
-
"--avatar-radius": typeof t == "number" ? `${t}px` : t
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function j({ status: t }) {
|
|
28
|
-
return /* @__PURE__ */ a.createElement(
|
|
29
|
-
"span",
|
|
30
|
-
{
|
|
31
|
-
className: p(e.b, t === "online" ? e.o : e.f),
|
|
32
|
-
"data-status": t,
|
|
33
|
-
"aria-hidden": !0
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
function k({
|
|
38
|
-
src: t,
|
|
39
|
-
label: n,
|
|
40
|
-
children: s,
|
|
41
|
-
name: c,
|
|
42
|
-
status: o
|
|
43
|
-
}) {
|
|
44
|
-
const l = t != null && t !== "" ? /* @__PURE__ */ a.createElement("img", { className: e.i, src: t, alt: n ?? "", draggable: !1 }) : s ?? (c != null ? $(c) : "?");
|
|
45
|
-
return /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement("span", { className: e.v }, l), o != null ? /* @__PURE__ */ a.createElement(j, { status: o }) : null);
|
|
46
|
-
}
|
|
47
|
-
function G(t) {
|
|
48
|
-
const {
|
|
49
|
-
src: n,
|
|
50
|
-
alt: s,
|
|
51
|
-
name: c,
|
|
52
|
-
size: o = "m",
|
|
53
|
-
status: l,
|
|
54
|
-
active: i,
|
|
55
|
-
children: b,
|
|
56
|
-
className: y,
|
|
57
|
-
radius: E,
|
|
58
|
-
as: f = "span",
|
|
59
|
-
style: N,
|
|
60
|
-
...m
|
|
61
|
-
} = t, g = o === "s" ? e.s : o === "l" ? e.l : e.m, u = p(e.r, g, i && e.a, y), r = s ?? c, d = { ...D(E), ...N }, v = /* @__PURE__ */ a.createElement(
|
|
62
|
-
k,
|
|
63
|
-
{
|
|
64
|
-
src: n,
|
|
65
|
-
label: r,
|
|
66
|
-
name: c,
|
|
67
|
-
status: l,
|
|
68
|
-
children: b
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
return f === "button" ? /* @__PURE__ */ a.createElement(
|
|
72
|
-
"button",
|
|
73
|
-
{
|
|
74
|
-
type: "button",
|
|
75
|
-
className: u,
|
|
76
|
-
"aria-label": r,
|
|
77
|
-
"data-active": i ? "true" : void 0,
|
|
78
|
-
"data-status": l,
|
|
79
|
-
style: d,
|
|
80
|
-
...m
|
|
81
|
-
},
|
|
82
|
-
v
|
|
83
|
-
) : f === "div" ? /* @__PURE__ */ a.createElement(
|
|
84
|
-
"div",
|
|
85
|
-
{
|
|
86
|
-
className: u,
|
|
87
|
-
role: r ? "img" : void 0,
|
|
88
|
-
"aria-label": r,
|
|
89
|
-
"data-active": i ? "true" : void 0,
|
|
90
|
-
"data-status": l,
|
|
91
|
-
style: d,
|
|
92
|
-
...m
|
|
93
|
-
},
|
|
94
|
-
v
|
|
95
|
-
) : /* @__PURE__ */ a.createElement(
|
|
96
|
-
"span",
|
|
97
|
-
{
|
|
98
|
-
className: u,
|
|
99
|
-
role: r ? "img" : void 0,
|
|
100
|
-
"aria-label": r,
|
|
101
|
-
"data-active": i ? "true" : void 0,
|
|
102
|
-
"data-status": l,
|
|
103
|
-
style: d,
|
|
104
|
-
...m
|
|
105
|
-
},
|
|
106
|
-
v
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
export {
|
|
110
|
-
G as A,
|
|
111
|
-
D as a,
|
|
112
|
-
$ as i
|
|
113
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import n from "react";
|
|
2
|
-
import { A as f } from "./Avatar-loGgFt72.js";
|
|
3
|
-
import { c as u } from "./cx-CcykAxZN.js";
|
|
4
|
-
import './AvatarGroup.css';const G = "cyr", I = "cyi", M = "cyo", R = "cyd", S = "cys", j = "cym", q = "cyl", l = {
|
|
5
|
-
r: G,
|
|
6
|
-
i: I,
|
|
7
|
-
o: M,
|
|
8
|
-
d: R,
|
|
9
|
-
s: S,
|
|
10
|
-
m: j,
|
|
11
|
-
l: q
|
|
12
|
-
};
|
|
13
|
-
function w(a) {
|
|
14
|
-
if (a.name != null && a.name !== "") return a.name;
|
|
15
|
-
if (a.title != null && a.title !== "") return a.title;
|
|
16
|
-
}
|
|
17
|
-
function F({
|
|
18
|
-
items: a,
|
|
19
|
-
max: c,
|
|
20
|
-
size: s = "m",
|
|
21
|
-
add: g = !1,
|
|
22
|
-
addLabel: v = "Добавить",
|
|
23
|
-
onAdd: r,
|
|
24
|
-
onItemClick: i,
|
|
25
|
-
className: E,
|
|
26
|
-
"aria-label": h = "Аватары",
|
|
27
|
-
...N
|
|
28
|
-
}) {
|
|
29
|
-
const p = s === "s" ? l.s : s === "l" ? l.l : l.m, k = c != null && c >= 0 ? Math.min(c, a.length) : a.length, y = a.slice(0, k), e = a.length - y.length;
|
|
30
|
-
return /* @__PURE__ */ n.createElement(
|
|
31
|
-
"div",
|
|
32
|
-
{
|
|
33
|
-
className: u(l.r, E),
|
|
34
|
-
role: "group",
|
|
35
|
-
"aria-label": h,
|
|
36
|
-
...N
|
|
37
|
-
},
|
|
38
|
-
y.map((t, o) => {
|
|
39
|
-
const C = t.value ?? t.title ?? t.name ?? t.src ?? String(o), b = w(t), m = t.alt ?? t.title ?? t.name, P = i != null;
|
|
40
|
-
return /* @__PURE__ */ n.createElement("span", { key: C, className: l.i, style: { zIndex: o + 1 } }, P ? /* @__PURE__ */ n.createElement(
|
|
41
|
-
f,
|
|
42
|
-
{
|
|
43
|
-
as: "button",
|
|
44
|
-
src: t.src,
|
|
45
|
-
name: b,
|
|
46
|
-
alt: m,
|
|
47
|
-
size: s,
|
|
48
|
-
status: t.status,
|
|
49
|
-
onClick: ($) => {
|
|
50
|
-
$.stopPropagation(), i(t, o);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
) : /* @__PURE__ */ n.createElement(
|
|
54
|
-
f,
|
|
55
|
-
{
|
|
56
|
-
src: t.src,
|
|
57
|
-
name: b,
|
|
58
|
-
alt: m,
|
|
59
|
-
size: s,
|
|
60
|
-
status: t.status
|
|
61
|
-
}
|
|
62
|
-
));
|
|
63
|
-
}),
|
|
64
|
-
e > 0 ? /* @__PURE__ */ n.createElement("span", { className: u(l.o, p), "aria-label": `Ещё ${e}` }, "+", e) : null,
|
|
65
|
-
g ? /* @__PURE__ */ n.createElement(
|
|
66
|
-
"button",
|
|
67
|
-
{
|
|
68
|
-
type: "button",
|
|
69
|
-
className: u(l.d, p),
|
|
70
|
-
"aria-label": v,
|
|
71
|
-
onClick: (t) => {
|
|
72
|
-
t.stopPropagation(), r == null || r();
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
"+"
|
|
76
|
-
) : null
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
export {
|
|
80
|
-
F as A
|
|
81
|
-
};
|
|
@@ -1,68 +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 = "czx", C = "czt", F = "czd", I = "czs", R = "czm", S = "czl", e = {
|
|
5
|
-
r: y,
|
|
6
|
-
c: A,
|
|
7
|
-
x: h,
|
|
8
|
-
t: C,
|
|
9
|
-
d: F,
|
|
10
|
-
s: I,
|
|
11
|
-
m: R,
|
|
12
|
-
l: S
|
|
13
|
-
};
|
|
14
|
-
function $(s, n) {
|
|
15
|
-
if (s != null && s !== "") return s;
|
|
16
|
-
if (typeof n == "string") return n;
|
|
17
|
-
}
|
|
18
|
-
function w(s) {
|
|
19
|
-
const {
|
|
20
|
-
src: n,
|
|
21
|
-
name: c,
|
|
22
|
-
title: m,
|
|
23
|
-
description: i,
|
|
24
|
-
size: a = "m",
|
|
25
|
-
radius: p,
|
|
26
|
-
status: z,
|
|
27
|
-
className: E,
|
|
28
|
-
children: N,
|
|
29
|
-
extra: u,
|
|
30
|
-
as: d = "div",
|
|
31
|
-
...r
|
|
32
|
-
} = s, x = a === "s" ? e.s : a === "l" ? e.l : e.m, l = g(e.r, x, E), f = m ?? (typeof c == "string" ? c : void 0), v = $(c, m), o = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
33
|
-
b,
|
|
34
|
-
{
|
|
35
|
-
src: n,
|
|
36
|
-
name: v,
|
|
37
|
-
size: a,
|
|
38
|
-
radius: p,
|
|
39
|
-
status: z
|
|
40
|
-
}
|
|
41
|
-
), /* @__PURE__ */ t.createElement("span", { className: e.c }, f != null ? /* @__PURE__ */ t.createElement("span", { className: e.t }, f) : null, i != null ? /* @__PURE__ */ t.createElement("span", { className: e.d }, i) : null, N), u != null ? /* @__PURE__ */ t.createElement("span", { className: e.x }, u) : null);
|
|
42
|
-
return d === "button" ? /* @__PURE__ */ t.createElement(
|
|
43
|
-
"button",
|
|
44
|
-
{
|
|
45
|
-
type: "button",
|
|
46
|
-
className: l,
|
|
47
|
-
...r
|
|
48
|
-
},
|
|
49
|
-
o
|
|
50
|
-
) : d === "a" ? /* @__PURE__ */ t.createElement(
|
|
51
|
-
"a",
|
|
52
|
-
{
|
|
53
|
-
className: l,
|
|
54
|
-
...r
|
|
55
|
-
},
|
|
56
|
-
o
|
|
57
|
-
) : /* @__PURE__ */ t.createElement(
|
|
58
|
-
"div",
|
|
59
|
-
{
|
|
60
|
-
className: l,
|
|
61
|
-
...r
|
|
62
|
-
},
|
|
63
|
-
o
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
export {
|
|
67
|
-
w as A
|
|
68
|
-
};
|
package/dist/Badge-jp-9iNNL.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import t from "react";
|
|
2
|
-
import { c as j } from "./cx-CcykAxZN.js";
|
|
3
|
-
import './Badge.css';const u = "cjr", i = "cjs", p = "cjm", w = "cjl", f = "cjn", g = "cja", N = "cju", h = "cjw", x = "cjd", z = "cjo", s = {
|
|
4
|
-
r: u,
|
|
5
|
-
s: i,
|
|
6
|
-
m: p,
|
|
7
|
-
l: w,
|
|
8
|
-
n: f,
|
|
9
|
-
a: g,
|
|
10
|
-
u: N,
|
|
11
|
-
w: h,
|
|
12
|
-
d: x,
|
|
13
|
-
o: z
|
|
14
|
-
};
|
|
15
|
-
function E(e) {
|
|
16
|
-
const {
|
|
17
|
-
tone: c = "neutral",
|
|
18
|
-
size: n = "m",
|
|
19
|
-
dot: o,
|
|
20
|
-
children: a,
|
|
21
|
-
className: r,
|
|
22
|
-
...l
|
|
23
|
-
} = e, m = c === "accent" ? s.a : c === "success" ? s.u : c === "warning" ? s.w : c === "danger" ? s.d : s.n, d = n === "s" ? s.s : n === "l" ? s.l : s.m;
|
|
24
|
-
return /* @__PURE__ */ t.createElement("span", { className: j(s.r, d, m, r), ...l }, o ? /* @__PURE__ */ t.createElement("span", { className: s.o, "aria-hidden": !0 }) : null, a);
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
E as B
|
|
28
|
-
};
|
package/dist/Banner-B72lcEMo.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import e from "react";
|
|
2
|
-
import { c as a } from "./cx-CcykAxZN.js";
|
|
3
|
-
import './Banner.css';const i = "cLr", d = "cLi", m = "cLw", f = "cLd", w = "cLs", s = {
|
|
4
|
-
r: i,
|
|
5
|
-
i: d,
|
|
6
|
-
w: m,
|
|
7
|
-
d: f,
|
|
8
|
-
s: w
|
|
9
|
-
}, L = {
|
|
10
|
-
info: s.i,
|
|
11
|
-
warning: s.w,
|
|
12
|
-
danger: s.d,
|
|
13
|
-
success: s.s
|
|
14
|
-
};
|
|
15
|
-
function p({
|
|
16
|
-
tone: c = "info",
|
|
17
|
-
className: n,
|
|
18
|
-
role: t = "status",
|
|
19
|
-
children: o,
|
|
20
|
-
...r
|
|
21
|
-
}) {
|
|
22
|
-
return /* @__PURE__ */ e.createElement(
|
|
23
|
-
"div",
|
|
24
|
-
{
|
|
25
|
-
className: a(s.r, L[c], n),
|
|
26
|
-
role: t,
|
|
27
|
-
...r
|
|
28
|
-
},
|
|
29
|
-
o
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
p as B
|
|
34
|
-
};
|