elcrm 1.1.15 → 1.1.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elcrm",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "description": "CLI @elcrm/*: doctor --fix (порядок проекта), update, css, docs, cursor, migrate",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -14,7 +14,7 @@ Shell UI: оболочка, шапка, секции, списки, Dropdown / R
14
14
  import {
15
15
  Layout, Header, Footer, Brand, Avatar, AvatarName, AvatarGroup, Badge,
16
16
  Menu, Dropdown, Section, NavSections, TabSections, Breadcrumb, Stack,
17
- Card, Stat, ActionGroup, TextGroup, ItemColumn, List, Item, PageHead, PageShell, Sidebar, Popover,
17
+ Card, Stat, ActionGroup, TextGroup, ItemColumn, List, Item, PageHead, PageShell, ChatList, ChatMessages, ChatSplit, Sidebar, Popover,
18
18
  Loading, EmptyState, RadioGroup, PricingGroup, PricingTable,
19
19
  createLazyResolver,
20
20
  } from "@elcrm/components";
@@ -24,10 +24,13 @@ import type { PricingPlan } from "@elcrm/components";
24
24
  ## Роли layout
25
25
 
26
26
  - **PageShell** — каркас модуля (`scroll` в body + footer). `scroll={false}` — без внутреннего скролла.
27
+ - **ChatList** — колонка диалогов: слоты `header` / `footer`, `children` = `List` + `Item`. Токены `--chat-list-width`, `--chat-*` (алиасы `--shell-*`).
28
+ - **ChatMessages** — колонка переписки. `bodyRef` / `onBodyScroll`. Паддинги `--chat-messages-*-padding`.
29
+ - **ChatSplit** — ряд `list` + `messages` (`--chat-split-gap`).
27
30
  - **PageHead** — title + actions. `sup` — текст или Badge сразу после title (надстрочно; `0` скрыт). `sticky` — шапка прилипает к верху скролла (фон `--shell-bg`). `children` — фильтры/поиск под заголовком, отступ `--shell-gap`.
28
31
  - **Section** — блок контента / auth.
29
- - **Layout / Header** — оболочка приложения. `Layout sidebar={<Sidebar />}` — ряд: меню слева + контент.
30
- - **Sidebar** — левое меню. `variant="cards"` (карточки) или `"plain"` (плоский backoffice). `groups` + `value`. Слоты: `brand`, `extra`, `footer`. Пункты: `--sidebar-item-font-size`, `--sidebar-item-padding`, `--sidebar-icon-size`, `--sidebar-group-font-size`. Не наследуют `body` 18px (`Item` `font: inherit` перебит).
32
+ - **Layout / Header** — оболочка приложения. `Layout sidebar={<Sidebar />}` — ряд: меню слева + контент. `fixed={["header", "footer", "sidebar"]}` (по умолчанию) — эти слоты не скроллятся, крутится только `children`. `fixed={[]}` — поток страницы. Высота каркаса: `--layout-height` (`100dvh`).
33
+ - **Sidebar** — левое меню. `variant="cards"` (карточки) или `"plain"` (плоский backoffice). `groups` + `value`. Слоты: `brand`, `extra`, `footer`. Меню аккаунта: `footerItems` (как у Dropdown) + `onFooterSelect` — клик по `footer` открывает панель, справа ⋮. Пункты: `--sidebar-item-font-size`, `--sidebar-item-padding`, `--sidebar-icon-size`, `--sidebar-group-font-size`. Не наследуют `body` 18px (`Item` `font: inherit` перебит).
31
34
  - **Stack** — ряд/колонка/сетка (`direction="row"|"column"|"grid"`). Не `Block` / `Row` / `Column`. Сетка: `auto-fit` + `--stack-grid-min`, либо `columns={4}` / `columns={["1fr", "100px", "auto"]}`. С `columns` ряды `stretch` (карточки не наезжают); в одну линию — `style={{ alignItems: "center" }}`. Не `height: 100%` у детей сетки.
32
35
  - **Card** — курсор: `--card-pointer` (`auto` / `pointer`). Сетка Stack: `--stack-grid-min`.
33
36
  - **Stat** — метрика: `label` + `value`, `tone` как у Badge, `labelMuted`. Не собирать из `span` в приложении.
@@ -55,6 +58,8 @@ import type { PricingPlan } from "@elcrm/components";
55
58
 
56
59
  ## Можно
57
60
 
61
+ - `--layout-height` — высота каркаса `Layout` при `fixed` (по умолчанию `100dvh`).
62
+ - Узкие токены (`--chat-*`, `--sidebar-*`, `--item-column-*`) по умолчанию = `--shell-*`. Переопределяй только отличие.
58
63
  - Задать `--shell-color` / `--shell-padding` / `--shell-radius` один раз — большинство компонентов подхватят.
59
64
  - `--popup-shadow` общий с `@elcrm/form`.
60
65
  - `elcrm css` — недостающие `--shell-*`.
@@ -23,7 +23,7 @@ const form = useForm({ login: "", password: "" });
23
23
 
24
24
  Канонические поля: `StringField`, `PasswordField`, `TextareaField`, `NumberField`, `PercentField`, `MoneyField`, `MaskField`, `PhoneField`, `EmailField`, `UrlField`, `DateField`, `TimeField`, `SelectField`, `OptionsField`, `ModalField`, `RangeField`, `CheckField`, `RadioField`, `TagsField`, `RatingField`, `CodeField`, `FileField`, `DragDropField`, `RichTextField`, `ColorField`, `HiddenField`, `DisplayField`, `SearchField`, `TabsField`.
25
25
 
26
- `before` / `after` — слоты (иконки). Размеры: `"s"` | `"m"` | `"l"`, не `sm`/`md`.
26
+ `disabled`, `size` (`"s"` | `"m"` | `"l"`) у всех видимых `*Field` (кроме `HiddenField`).
27
27
 
28
28
  `PasswordField`: `generate` — кнопка случайного пароля. `true` → `Az09#` (A–Z, a–z, 0–9, символы). `generate="A"` только заглавные, `"59"` цифры 5–9, `"#"` только символы. Длина — `maxLength` или 12.
29
29
 
@@ -127,7 +127,7 @@ body[data-theme="dark"] {
127
127
  --shell-border: var(--line);
128
128
  --shell-background: var(--panel);
129
129
  --shell-background-muted: var(--bg);
130
- --shell-bg: var(--bg);
130
+ --shell-bg: var(--shell-background-muted);
131
131
  --sidebar-block-bg: var(--shell-background);
132
132
  --sidebar-block-border: var(--shell-border);
133
133
  --sidebar-block-shadow: none;
@@ -145,4 +145,7 @@ body[data-theme="dark"] {
145
145
  --avatar-border: 1px solid var(--shell-border);
146
146
  --avatar-outline-active: 2px solid
147
147
  color-mix(in srgb, var(--accent) 70%, white);
148
+
149
+ --chat-background: var(--shell-background);
150
+ --chat-border: 1px solid var(--shell-border);
148
151
  }
@@ -127,7 +127,7 @@ body[data-theme="light"] {
127
127
  --shell-border: var(--line);
128
128
  --shell-background: var(--panel);
129
129
  --shell-background-muted: var(--bg);
130
- --shell-bg: var(--bg);
130
+ --shell-bg: var(--shell-background-muted);
131
131
  --sidebar-block-bg: var(--shell-background);
132
132
  --sidebar-block-border: var(--shell-border);
133
133
  --sidebar-block-shadow: none;
@@ -145,4 +145,7 @@ body[data-theme="light"] {
145
145
  --avatar-border: 1px solid var(--shell-border);
146
146
  --avatar-outline-active: 2px solid
147
147
  color-mix(in srgb, var(--accent) 70%, white);
148
+
149
+ --chat-background: var(--shell-background);
150
+ --chat-border: 1px solid var(--shell-border);
148
151
  }
@@ -78,6 +78,7 @@
78
78
  --shell-status-size: 10px;
79
79
  --shell-disabled-opacity: 0.55;
80
80
  --shell-z: 1000;
81
+ --layout-height: 100dvh;
81
82
  --elcrm-z-popover: 1000;
82
83
 
83
84
  /* —— узкие (@elcrm/components) —— */
@@ -92,7 +93,7 @@
92
93
  --section-title-size-md: 1.25rem;
93
94
  --section-auth-card-max-width: 22rem;
94
95
 
95
- --nav-sections-padding: 1.5rem 1.75rem 2.5rem;
96
+ --nav-sections-padding: var(--section-padding);
96
97
  --nav-sections-nav-width: 220px;
97
98
  --nav-sections-main-max-width: 720px;
98
99
 
@@ -117,20 +118,32 @@
117
118
  --stack-grid-min: 180px;
118
119
  /* Задаётся Stack через style при columns=…; дефолт — одна колонка */
119
120
  --stack-columns-template: minmax(0, 1fr);
120
- --item-column-gap: 12px;
121
+ --item-column-gap: var(--shell-gap);
121
122
  --item-column-icon-size: 40px;
122
- --item-column-icon-radius: 999px;
123
+ --item-column-icon-radius: var(--avatar-radius);
124
+ --item-column-title-size: var(--shell-font-size);
125
+ --item-column-title-line: 1.3;
123
126
  --stat-value-size: 1.75rem;
127
+ --action-group-gap: var(--shell-gap-sm);
124
128
  --sidebar-width: 260px;
125
- --sidebar-pad-x: 12px;
126
- --sidebar-pad-y: 16px;
127
- --sidebar-block-radius: 14px;
128
- --sidebar-item-font-size: 13px;
129
+ --sidebar-pad-x: var(--shell-gap);
130
+ --sidebar-pad-y: var(--shell-gap-lg);
131
+ --sidebar-block-radius: var(--shell-radius);
132
+ --sidebar-item-font-size: var(--shell-font-size-sm);
129
133
  --sidebar-item-padding: 6px 10px;
130
134
  --sidebar-icon-size: 16px;
131
135
  --sidebar-group-font-size: 11px;
132
136
  --pricing-card-min-width: 16rem;
133
137
  --pricing-table-label-width: 10rem;
138
+ --chat-list-width: 340px;
139
+ --chat-split-gap: var(--shell-gap-lg);
140
+ --chat-radius: var(--shell-radius);
141
+ --chat-header-padding: var(--shell-gap);
142
+ --chat-body-padding: 0;
143
+ --chat-footer-padding: var(--shell-gap);
144
+ --chat-messages-header-padding: 14px 16px;
145
+ --chat-messages-body-padding: 16px 16px 20px;
146
+ --chat-messages-footer-padding: 10px 12px 12px;
134
147
  }
135
148
 
136
149
  /* —— база приложения (без захардкоженных цветов) —— */
@@ -127,7 +127,7 @@ body[data-theme="dark"] {
127
127
  --shell-border: var(--line);
128
128
  --shell-background: var(--panel);
129
129
  --shell-background-muted: var(--bg);
130
- --shell-bg: var(--bg);
130
+ --shell-bg: var(--shell-background-muted);
131
131
  --sidebar-block-bg: var(--shell-background);
132
132
  --sidebar-block-border: var(--shell-border);
133
133
  --sidebar-block-shadow: none;
@@ -145,4 +145,6 @@ body[data-theme="dark"] {
145
145
  --avatar-border: 1px solid var(--shell-border);
146
146
  --avatar-outline-active: 2px solid
147
147
  color-mix(in srgb, var(--accent) 70%, white);
148
+ --chat-background: var(--shell-background);
149
+ --chat-border: 1px solid var(--shell-border);
148
150
  }
@@ -127,7 +127,7 @@ body[data-theme="light"] {
127
127
  --shell-border: var(--line);
128
128
  --shell-background: var(--panel);
129
129
  --shell-background-muted: var(--bg);
130
- --shell-bg: var(--bg);
130
+ --shell-bg: var(--shell-background-muted);
131
131
  --sidebar-block-bg: var(--shell-background);
132
132
  --sidebar-block-border: var(--shell-border);
133
133
  --sidebar-block-shadow: none;
@@ -145,4 +145,6 @@ body[data-theme="light"] {
145
145
  --avatar-border: 1px solid var(--shell-border);
146
146
  --avatar-outline-active: 2px solid
147
147
  color-mix(in srgb, var(--accent) 70%, white);
148
+ --chat-background: var(--shell-background);
149
+ --chat-border: 1px solid var(--shell-border);
148
150
  }
@@ -78,6 +78,7 @@
78
78
  --shell-status-size: 10px;
79
79
  --shell-disabled-opacity: 0.55;
80
80
  --shell-z: 1000;
81
+ --layout-height: 100dvh;
81
82
  --elcrm-z-popover: 1000;
82
83
 
83
84
  /* —— узкие (@elcrm/components) —— */
@@ -92,7 +93,7 @@
92
93
  --section-title-size-md: 1.25rem;
93
94
  --section-auth-card-max-width: 22rem;
94
95
 
95
- --nav-sections-padding: 1.5rem 1.75rem 2.5rem;
96
+ --nav-sections-padding: var(--section-padding);
96
97
  --nav-sections-nav-width: 220px;
97
98
  --nav-sections-main-max-width: 720px;
98
99
 
@@ -117,19 +118,32 @@
117
118
  --stack-grid-min: 180px;
118
119
  /* Задаётся Stack через style при columns=…; дефолт — одна колонка */
119
120
  --stack-columns-template: minmax(0, 1fr);
120
- --item-column-gap: 12px;
121
+ --item-column-gap: var(--shell-gap);
121
122
  --item-column-icon-size: 40px;
122
- --item-column-icon-radius: 999px;
123
+ --item-column-icon-radius: var(--avatar-radius);
124
+ --item-column-title-size: var(--shell-font-size);
125
+ --item-column-title-line: 1.3;
126
+ --stat-value-size: 1.75rem;
127
+ --action-group-gap: var(--shell-gap-sm);
123
128
  --sidebar-width: 248px;
124
- --sidebar-pad-x: 12px;
125
- --sidebar-pad-y: 16px;
126
- --sidebar-block-radius: 14px;
127
- --sidebar-item-font-size: 13px;
129
+ --sidebar-pad-x: var(--shell-gap);
130
+ --sidebar-pad-y: var(--shell-gap-lg);
131
+ --sidebar-block-radius: var(--shell-radius);
132
+ --sidebar-item-font-size: var(--shell-font-size-sm);
128
133
  --sidebar-item-padding: 6px 10px;
129
134
  --sidebar-icon-size: 16px;
130
135
  --sidebar-group-font-size: 11px;
131
136
  --pricing-card-min-width: 16rem;
132
137
  --pricing-table-label-width: 10rem;
138
+ --chat-list-width: 340px;
139
+ --chat-split-gap: var(--shell-gap-lg);
140
+ --chat-radius: var(--shell-radius);
141
+ --chat-header-padding: var(--shell-gap);
142
+ --chat-body-padding: 0;
143
+ --chat-footer-padding: var(--shell-gap);
144
+ --chat-messages-header-padding: 14px 16px;
145
+ --chat-messages-body-padding: 16px 16px 20px;
146
+ --chat-messages-footer-padding: 10px 12px 12px;
133
147
  }
134
148
 
135
149
  /* —— база приложения (без захардкоженных цветов) —— */