@sberbusiness/triplex-next-mcp-server 0.24.0-beta2 → 1.40.0-beta

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 (73) hide show
  1. package/README.md +10 -0
  2. package/bundle/components/AlertContext.md +268 -0
  3. package/bundle/components/BodyPage.md +186 -0
  4. package/bundle/components/Button.md +93 -85
  5. package/bundle/components/ButtonDropdown.md +36 -70
  6. package/bundle/components/ButtonDropdownExtended.md +422 -0
  7. package/bundle/components/ButtonIcon.md +41 -48
  8. package/bundle/components/Caption.md +291 -0
  9. package/bundle/components/Checkbox.md +43 -122
  10. package/bundle/components/CheckboxXGroup.md +109 -46
  11. package/bundle/components/CheckboxYGroup.md +77 -49
  12. package/bundle/components/CodeText.md +197 -0
  13. package/bundle/components/Col.md +311 -162
  14. package/bundle/components/CollapsibleTree.md +584 -0
  15. package/bundle/components/CollapsibleTreeExtended.md +422 -0
  16. package/bundle/components/Dropdown.md +748 -346
  17. package/bundle/components/EmptyView.md +14 -15
  18. package/bundle/components/FooterPage.md +203 -0
  19. package/bundle/components/Gap.md +115 -57
  20. package/bundle/components/HeaderPage.md +226 -0
  21. package/bundle/components/HelpBox.md +45 -84
  22. package/bundle/components/ImageGallery.md +423 -0
  23. package/bundle/components/ImageGalleryExtended.md +606 -0
  24. package/bundle/components/LightBox.md +2252 -233
  25. package/bundle/components/List.md +216 -183
  26. package/bundle/components/ListActionItem.md +157 -0
  27. package/bundle/components/ListItem.md +276 -0
  28. package/bundle/components/ListItemControlsButton.md +103 -0
  29. package/bundle/components/ListItemControlsButtonDropdown.md +107 -0
  30. package/bundle/components/ListItemSelectable.md +99 -0
  31. package/bundle/components/ListItemTable.md +390 -0
  32. package/bundle/components/ListMaster.md +876 -156
  33. package/bundle/components/ListMasterFooter.md +80 -0
  34. package/bundle/components/ListMasterHeader.md +86 -0
  35. package/bundle/components/ListSortable.md +153 -0
  36. package/bundle/components/ListSortableItem.md +175 -0
  37. package/bundle/components/ListTableItem.md +391 -0
  38. package/bundle/components/ModalWindow.md +427 -237
  39. package/bundle/components/MonthYearField.md +145 -109
  40. package/bundle/components/Notification.md +625 -155
  41. package/bundle/components/Overlay.md +271 -170
  42. package/bundle/components/Page.md +284 -186
  43. package/bundle/components/Pagination.md +206 -229
  44. package/bundle/components/Portal.md +131 -67
  45. package/bundle/components/Row.md +171 -69
  46. package/bundle/components/Text.md +320 -0
  47. package/bundle/components/TextField.md +364 -97
  48. package/bundle/components/Title.md +296 -0
  49. package/bundle/guides/codestyle.md +38 -11
  50. package/bundle/guides/commits.md +119 -26
  51. package/bundle/guides/context.md +34 -30
  52. package/bundle/guides/stories.md +110 -40
  53. package/bundle/guides/template.md +3 -7
  54. package/bundle/guides/tests.md +48 -2
  55. package/bundle/manifest.json +275 -30
  56. package/bundle/release-notes/1.26.0.mdx +33 -2
  57. package/bundle/release-notes/1.27.0.mdx +43 -0
  58. package/bundle/release-notes/1.28.0.mdx +25 -0
  59. package/bundle/release-notes/1.29.0.mdx +47 -0
  60. package/bundle/release-notes/1.30.0.mdx +56 -0
  61. package/bundle/release-notes/1.31.0.mdx +52 -0
  62. package/bundle/release-notes/1.32.0.mdx +35 -0
  63. package/bundle/release-notes/1.33.0.mdx +61 -0
  64. package/bundle/release-notes/1.34.0.mdx +35 -0
  65. package/bundle/release-notes/1.35.0.mdx +21 -0
  66. package/bundle/release-notes/1.35.1.mdx +11 -0
  67. package/bundle/release-notes/1.36.0.mdx +21 -0
  68. package/bundle/release-notes/1.37.0.mdx +71 -0
  69. package/bundle/release-notes/1.38.0.mdx +36 -0
  70. package/bundle/release-notes/1.39.0.mdx +66 -0
  71. package/bundle/release-notes/1.40.0.mdx +27 -0
  72. package/bundle/release-notes/1.41.0.mdx +7 -0
  73. package/package.json +1 -1
@@ -0,0 +1,390 @@
1
+ ---
2
+ component: ListItemTable
3
+ category: List
4
+ related: [ListItem, ListItemSelectable, ListItemControls, ListItemControlsButton, SwipeableArea]
5
+ tokens:
6
+ - --triplex-next-ListItem-Background
7
+ - --triplex-next-ListItem-Background_Selected
8
+ stories: stories/List/ListItemTable.stories.tsx
9
+ version: "1.0"
10
+ ---
11
+
12
+ # ListItemTable
13
+
14
+ ## Назначение
15
+
16
+ Высокоуровневая обёртка `<li>` для табличных строк. Объединяет `ListItem` +
17
+ `SwipeableArea` + опциональный `ListItemSelectable`. Автоматически рисует
18
+ правый «хвост» (`ListItemTailRight`) и контейнер для swipe-actions
19
+ (`ListItemControls`).
20
+
21
+ Используй `ListItemTable` когда: нужна готовая строка с поддержкой swipe и
22
+ выбора. Не нужен — собирай руками из `ListItem` + `ListItemContent` +
23
+ `SwipeableArea` + `ListItemSelectable`.
24
+
25
+ ---
26
+
27
+ ## Варианты и props
28
+
29
+ `ListItemTable` имеет **discriminated union** API: либо без выбора (`onSelect`/`selected` запрещены типом), либо selectable (оба обязательны).
30
+
31
+ ### Общие опциональные props
32
+
33
+ | Prop | Тип | По умолчанию | Описание |
34
+ |---|---|---|---|
35
+ | `controlButtons` | `React.ReactNode` | — | Кнопки действий, оборачиваются в `<ListItemControls>` и подключаются как `rightSwipeableArea` у `SwipeableArea` |
36
+ | `onClickItem` | `(event: React.MouseEvent<HTMLDivElement>) => void` | — | Передаётся как `onClick` на контейнер контента (`ListItemContent`). Не вызывается при клике на чекбокс или swipe-actions |
37
+ | `swipeableAreaRef` | `React.Ref<ISwipeableAreaRef>` | — | Ref на внутренний `SwipeableArea` (для программного открытия/закрытия swipe-области, например в `WithSwipeEmulation`-сторе) |
38
+ | `children` | `React.ReactNode` | — | Содержимое строки (рендерится внутри `ListItemContent`) |
39
+
40
+ ### Selectable-вариант (оба prop'а обязательны вместе)
41
+
42
+ | Prop | Тип | Описание |
43
+ |---|---|---|
44
+ | `selected` | `boolean` | Состояние «выбран» — управляется снаружи |
45
+ | `onSelect` | `(selected: boolean) => void` | Вызывается при изменении состояния чекбокса |
46
+
47
+ В non-selectable варианте оба prop'а имеют тип `never` — TypeScript запрещает их передачу.
48
+
49
+ ---
50
+
51
+ ## Дизайн-токены
52
+
53
+ ```text
54
+ --triplex-next-ListItem-Background // фон строки
55
+ --triplex-next-ListItem-Background_Selected // фон выбранной строки (через ListItemSelectable + ListItemContent)
56
+ ```
57
+
58
+ Применяются в подкомпонентах `ListItemContent`/`ListItemSelectable`. Сам
59
+ `ListItemTable.module.less` задаёт только `margin-bottom: 4px` и
60
+ `border-radius: 8px` для `swipeableArea`.
61
+
62
+ ---
63
+
64
+ ## Инварианты
65
+
66
+ - **`forwardRef`** — обязателен, target — `HTMLLIElement`. Не убирать.
67
+ - **Discriminated union** `IListItemTableProps | IListItemTableSelectableProps` — selectable определяется наличием **обоих** prop'ов `onSelect` и `selected`. Не делай частичную проверку.
68
+ - **Корневой элемент `<li>`** — не менять.
69
+ - **`SwipeableArea`** всегда оборачивает контент, даже без `controlButtons` — нужно для свайп-жестов на мобильных.
70
+
71
+ ---
72
+
73
+ ## Связанные компоненты
74
+
75
+ - `ListItem` — базовый `<li>`, используется внутри.
76
+ - `ListItemContent` — контейнер контента, получает `onClick = onClickItem`.
77
+ - `ListItemSelectable` — добавляется автоматически, если переданы `selected` + `onSelect`.
78
+ - `ListItemControls` — обёртка для `controlButtons`, подключается как `rightSwipeableArea`.
79
+ - `ListItemTailRight` — декоративный «хвост» в правой части (всегда отрисовывается).
80
+ - `SwipeableArea` — внешняя зависимость, обеспечивает swipe-жесты.
81
+
82
+ ---
83
+
84
+ ## Stories
85
+
86
+ Основные истории: `stories/List/ListItemTable.stories.tsx`
87
+ Файлы примеров: `stories/List/examples/ListItemTable/`
88
+
89
+ | Story | Example file | Что демонстрирует |
90
+ |---|---|---|
91
+ | `Playground` | `Playground.tsx` | Интерактивный контроль |
92
+ | `Default` | `Default.tsx` | Базовая табличная строка с `controlButtons` |
93
+ | `Selectable` | `Selectable.tsx` | Selectable-вариант с чекбоксом |
94
+ | `WithSwipeEmulation` | `WithSwipeEmulation.tsx` | Программное управление swipe через `swipeableAreaRef` |
95
+
96
+ ---
97
+
98
+ ## История изменений
99
+
100
+ | Дата | Изменение |
101
+ |---|---|
102
+ | 2026-04-29 | Создан документ |
103
+
104
+ ---
105
+
106
+ ## Примеры использования
107
+
108
+ ### Default
109
+
110
+ `stories/List/examples/ListItemTable/Default.tsx`
111
+
112
+ ```tsx
113
+ import React from "react";
114
+ import {
115
+ EComponentSize,
116
+ EFontType,
117
+ EFontWeightText,
118
+ EMarkerStatus,
119
+ ETextSize,
120
+ List,
121
+ ListItemControlsButton,
122
+ ListItemControlsButtonDropdown,
123
+ ListItemTable,
124
+ MarkerStatus,
125
+ Text,
126
+ } from "@sberbusiness/triplex-next";
127
+ import { AttachmentStrokeSrvIcon20, DotshorizontalStrokeSrvIcon20 } from "@sberbusiness/icons-next";
128
+
129
+ export const Default = () => {
130
+ const options = [
131
+ {
132
+ id: "button-dropdown-card-option-1",
133
+ label: "Текст пункта меню 1",
134
+ onSelect: () => {},
135
+ },
136
+ {
137
+ id: "button-dropdown-card-option-2",
138
+ label: "Текст пункта меню 2",
139
+ onSelect: () => {},
140
+ },
141
+ {
142
+ id: "button-dropdown-card-option-3",
143
+ label: "Текст пункта меню 3",
144
+ onSelect: () => {},
145
+ },
146
+ ];
147
+
148
+ return (
149
+ <div style={{ maxWidth: "500px" }}>
150
+ <List>
151
+ <ListItemTable
152
+ onClickItem={() => {}}
153
+ controlButtons={
154
+ <>
155
+ <ListItemControlsButton icon={<AttachmentStrokeSrvIcon20 paletteIndex={5} />}>
156
+ Скачать
157
+ </ListItemControlsButton>
158
+ <ListItemControlsButtonDropdown
159
+ icon={<DotshorizontalStrokeSrvIcon20 paletteIndex={5} />}
160
+ options={options}
161
+ >
162
+ Действия
163
+ </ListItemControlsButtonDropdown>
164
+ </>
165
+ }
166
+ >
167
+ <Text size={ETextSize.B2} weight={EFontWeightText.SEMIBOLD}>
168
+ 1 220 000 000 RUB
169
+ </Text>
170
+
171
+ <Text size={ETextSize.B3} tag="div">
172
+ №1 ООО Голубая Роза Голубая
173
+ </Text>
174
+ <Text size={ETextSize.B3} tag="div">
175
+ Длинное назначение платежа
176
+ </Text>
177
+ <Text size={ETextSize.B3} type={EFontType.SECONDARY} tag="div">
178
+ НДС не облагается
179
+ </Text>
180
+ <Text size={ETextSize.B3} tag="div" type={EFontType.SECONDARY}>
181
+ 40702 810 2 0527 5000000 от 09.04.24
182
+ </Text>
183
+ <MarkerStatus status={EMarkerStatus.SUCCESS} size={EComponentSize.LG}>
184
+ Status text
185
+ </MarkerStatus>
186
+ </ListItemTable>
187
+ </List>
188
+ </div>
189
+ );
190
+ };
191
+ ```
192
+
193
+ ### Selectable
194
+
195
+ `stories/List/examples/ListItemTable/Selectable.tsx`
196
+
197
+ ```tsx
198
+ import React from "react";
199
+ import {
200
+ EComponentSize,
201
+ EFontType,
202
+ EFontWeightText,
203
+ EMarkerStatus,
204
+ ETextSize,
205
+ List,
206
+ ListItemControlsButton,
207
+ ListItemControlsButtonDropdown,
208
+ ListItemTable,
209
+ MarkerStatus,
210
+ Text,
211
+ } from "@sberbusiness/triplex-next";
212
+ import { AttachmentStrokeSrvIcon20, DotshorizontalStrokeSrvIcon20 } from "@sberbusiness/icons-next";
213
+
214
+ export const Selectable = () => {
215
+ const options = [
216
+ {
217
+ id: "button-dropdown-card-with-selectable-option-1",
218
+ label: "Текст пункта меню 1",
219
+ onSelect: () => alert("Выбран пункт меню 1."),
220
+ },
221
+ {
222
+ id: "button-dropdown-card-with-selectable-option-2",
223
+ label: "Текст пункта меню 2",
224
+ onSelect: () => alert("Выбран пункт меню 2."),
225
+ },
226
+ {
227
+ id: "button-dropdown-card-with-selectable-option-3",
228
+ label: "Текст пункта меню 3",
229
+ onSelect: () => alert("Выбран пункт меню 3."),
230
+ },
231
+ ];
232
+
233
+ const [selected, setSelected] = React.useState(false);
234
+
235
+ return (
236
+ <div style={{ maxWidth: "500px" }}>
237
+ <List>
238
+ <ListItemTable
239
+ selected={selected}
240
+ onSelect={setSelected}
241
+ onClickItem={() => console.log("Клик по карточке.")}
242
+ controlButtons={
243
+ <>
244
+ <ListItemControlsButton icon={<AttachmentStrokeSrvIcon20 paletteIndex={5} />}>
245
+ Скачать
246
+ </ListItemControlsButton>
247
+ <ListItemControlsButtonDropdown
248
+ icon={<DotshorizontalStrokeSrvIcon20 paletteIndex={5} />}
249
+ options={options}
250
+ >
251
+ Действия
252
+ </ListItemControlsButtonDropdown>
253
+ </>
254
+ }
255
+ >
256
+ <Text size={ETextSize.B2} weight={EFontWeightText.SEMIBOLD}>
257
+ 1 220 000 000 RUB
258
+ </Text>
259
+
260
+ <Text size={ETextSize.B3} tag="div">
261
+ №1 ООО Голубая Роза Голубая
262
+ </Text>
263
+ <Text size={ETextSize.B3} tag="div">
264
+ Длинное назначение платежа
265
+ </Text>
266
+ <Text size={ETextSize.B3} type={EFontType.SECONDARY} tag="div">
267
+ НДС не облагается
268
+ </Text>
269
+ <Text size={ETextSize.B3} tag="div" type={EFontType.SECONDARY}>
270
+ 40702 810 2 0527 5000000 от 09.04.24
271
+ </Text>
272
+ <MarkerStatus status={EMarkerStatus.SUCCESS} size={EComponentSize.LG}>
273
+ Status text
274
+ </MarkerStatus>
275
+ </ListItemTable>
276
+ </List>
277
+ </div>
278
+ );
279
+ };
280
+ ```
281
+
282
+ ### WithSwipeEmulation
283
+
284
+ `stories/List/examples/ListItemTable/WithSwipeEmulation.tsx`
285
+
286
+ ```tsx
287
+ import React from "react";
288
+ import {
289
+ EComponentSize,
290
+ EFontType,
291
+ EFontWeightText,
292
+ EMarkerStatus,
293
+ ETextSize,
294
+ ISwipeableAreaRef,
295
+ List,
296
+ ListItemControlsButton,
297
+ ListItemControlsButtonDropdown,
298
+ ListItemTable,
299
+ MarkerStatus,
300
+ Text,
301
+ } from "@sberbusiness/triplex-next";
302
+ import { AttachmentStrokeSrvIcon20, DotshorizontalStrokeSrvIcon20 } from "@sberbusiness/icons-next";
303
+
304
+ export const WithSwipeEmulation = () => {
305
+ const options = [
306
+ {
307
+ id: "button-dropdown-swipe-emulation-option-1",
308
+ label: "Текст пункта меню 1",
309
+ onSelect: () => alert("Выбран пункт меню 1."),
310
+ },
311
+ {
312
+ id: "button-dropdown-swipe-emulation-card-option-2",
313
+ label: "Текст пункта меню 2",
314
+ onSelect: () => alert("Выбран пункт меню 2."),
315
+ },
316
+ {
317
+ id: "button-dropdown-swipe-emulation-card-option-3",
318
+ label: "Текст пункта меню 3",
319
+ onSelect: () => alert("Выбран пункт меню 3."),
320
+ },
321
+ ];
322
+
323
+ const ref = React.useRef<ISwipeableAreaRef>(null);
324
+
325
+ return (
326
+ <div style={{ maxWidth: "500px" }}>
327
+ <button
328
+ onClick={() => {
329
+ if (ref.current) {
330
+ ref.current.swipeLeft();
331
+ }
332
+ }}
333
+ >
334
+ swipe
335
+ </button>
336
+ <button
337
+ onClick={() => {
338
+ if (ref.current) {
339
+ ref.current.closeSwipe();
340
+ }
341
+ }}
342
+ >
343
+ close
344
+ </button>
345
+ <br />
346
+
347
+ <List>
348
+ <ListItemTable
349
+ swipeableAreaRef={ref}
350
+ onClickItem={() => console.log("Клик по карточке.")}
351
+ controlButtons={
352
+ <>
353
+ <ListItemControlsButton icon={<AttachmentStrokeSrvIcon20 paletteIndex={5} />}>
354
+ Скачать
355
+ </ListItemControlsButton>
356
+ <ListItemControlsButtonDropdown
357
+ icon={<DotshorizontalStrokeSrvIcon20 paletteIndex={5} />}
358
+ options={options}
359
+ >
360
+ Действия
361
+ </ListItemControlsButtonDropdown>
362
+ </>
363
+ }
364
+ >
365
+ <Text size={ETextSize.B2} weight={EFontWeightText.SEMIBOLD}>
366
+ 1 220 000 000 RUB
367
+ </Text>
368
+
369
+ <Text size={ETextSize.B3} tag="div">
370
+ №1 ООО Голубая Роза Голубая
371
+ </Text>
372
+ <Text size={ETextSize.B3} tag="div">
373
+ Длинное назначение платежа
374
+ </Text>
375
+ <Text size={ETextSize.B3} type={EFontType.SECONDARY} tag="div">
376
+ НДС не облагается
377
+ </Text>
378
+ <Text size={ETextSize.B3} tag="div" type={EFontType.SECONDARY}>
379
+ 40702 810 2 0527 5000000 от 09.04.24
380
+ </Text>
381
+ <MarkerStatus status={EMarkerStatus.SUCCESS} size={EComponentSize.LG}>
382
+ Status text
383
+ </MarkerStatus>
384
+ </ListItemTable>
385
+ </List>
386
+ </div>
387
+ );
388
+ };
389
+ ```
390
+