@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,320 @@
1
+ ---
2
+ component: Text
3
+ category: Typography
4
+ related: [Title, Caption, CodeText]
5
+ tokens:
6
+ - --triplex-next-Typography-Primary_Color
7
+ - --triplex-next-Typography-PrimaryInvert_Color
8
+ - --triplex-next-Typography-Complementary_Color
9
+ - --triplex-next-Typography-ComplementaryInvert_Color
10
+ - --triplex-next-Typography-Secondary_Color
11
+ - --triplex-next-Typography-SecondaryInvert_Color
12
+ - --triplex-next-Typography-Tertiary_Color
13
+ - --triplex-next-Typography-TertiaryInvert_Color
14
+ - --triplex-next-Typography-Disabled_Color
15
+ - --triplex-next-Typography-DisabledInvert_Color
16
+ - --triplex-next-Typography-Brand_Color
17
+ - --triplex-next-Typography-BrandInvert_Color
18
+ - --triplex-next-Typography-Info_Color
19
+ - --triplex-next-Typography-InfoInvert_Color
20
+ - --triplex-next-Typography-Success_Color
21
+ - --triplex-next-Typography-SuccessInvert_Color
22
+ - --triplex-next-Typography-Warning_Color
23
+ - --triplex-next-Typography-WarningInvert_Color
24
+ - --triplex-next-Typography-Error_Color
25
+ - --triplex-next-Typography-ErrorInvert_Color
26
+ - --triplex-next-Typography-System_Color
27
+ - --triplex-next-Typography-SystemInvert_Color
28
+ stories: stories/Typography/Text.stories.tsx
29
+ version: "1.0"
30
+ ---
31
+
32
+ # Text
33
+
34
+ ## Назначение
35
+
36
+ Основной текст интерфейса (типографика). Рендерит инлайновый `<span>` (тег настраивается через `tag`) со шрифтом SBSansText, размером из шкалы B1–B4 и цветом из палитры `EFontType`.
37
+
38
+ Используй когда: нужен основной или вспомогательный текст интерфейса — абзацы, подписи к контролам, значения в карточках.
39
+
40
+ Не используй когда:
41
+ - Нужен заголовок — используй `Title` (шрифт SBSansDisplay, семантические `h1`–`h3`).
42
+ - Нужен мелкий вспомогательный текст меньше 12px или крупная цифра/показатель — используй `Caption` (C1/C2/D1).
43
+ - Нужен моноширинный текст (код, ИНН, номера счетов) — используй `CodeText`.
44
+
45
+ ---
46
+
47
+ ## Варианты и props
48
+
49
+ ### Обязательные props
50
+
51
+ | Prop | Тип | Описание |
52
+ |---|---|---|
53
+ | `size` | `ETextSize` | Размер текста: `B1` (18/24px), `B2` (16/20px), `B3` (14/20px), `B4` (12/16px). В скобках — font-size/line-height. |
54
+
55
+ ### Опциональные props
56
+
57
+ | Prop | Тип | По умолчанию | Описание |
58
+ |---|---|---|---|
59
+ | `weight` | `EFontWeightText` | `REGULAR` | Начертание: `REGULAR` (SBSansText) или `SEMIBOLD` (SBSansTextSemibold, font-weight 600). |
60
+ | `line` | `ELineType` | `NORMAL` | Интерлиньяж. `COMPACT` фактически влияет только на размер `B3` (line-height 20px → 16px); для остальных размеров компактного варианта в стилях нет. |
61
+ | `type` | `EFontType` | `PRIMARY` | Цвет текста из палитры типографики: 11 базовых значений + 11 `*_INVERT` для тёмных подложек. |
62
+ | `underline` | `boolean` | — | Подчёркивание. Совместим со `strikethrough` (оба сразу — `underline line-through`). |
63
+ | `strikethrough` | `boolean` | — | Зачёркивание. |
64
+ | `tag` | `string` | `"span"` | HTML-тег корневого элемента (`span`, `div`, `p` и т.д.). |
65
+
66
+ Компонент типизирован как `TTextProps<T extends keyof JSX.IntrinsicElements>` и принимает все атрибуты соответствующего HTML-элемента (включая `className`, `style`, `aria-*`, `data-*`) через spread.
67
+
68
+ ### Ограничения
69
+
70
+ - Внешний тип `forwardRef<HTMLElement, TTextProps<keyof JSX.IntrinsicElements>>` «растворяет» дженерик: TypeScript не сужает атрибуты под конкретный `tag`. Известное ограничение публичного API, не исправлять без обсуждения (breaking).
71
+ - `EFontType.BRAND` дополнительно задаёт `user-select: none` (особенность стилей `Typography.module.less`, унаследованная от дизайна).
72
+
73
+ ---
74
+
75
+ ## Дизайн-токены
76
+
77
+ Цвета — только через CSS-переменные группы Typography (общие для всего семейства, см. frontmatter):
78
+
79
+ ```text
80
+ --triplex-next-Typography-{Type}_Color
81
+ --triplex-next-Typography-{Type}Invert_Color
82
+ ```
83
+
84
+ где `{Type}` ∈ Primary, Complementary, Secondary, Tertiary, Disabled, Brand, Info, Success, Warning, Error, System.
85
+
86
+ Размеры шрифта и line-height — фиксированные пиксельные значения в `styles/Text.module.less` (компонент-специфичные литералы, токенов для них нет).
87
+
88
+ ---
89
+
90
+ ## Инварианты
91
+
92
+ - **`forwardRef`** — обязателен, `ref: React.ForwardedRef<HTMLElement>` пробрасывается на корневой элемент.
93
+ - **Значения enum** `ETextSize`, `EFontWeightText`, `ELineType`, `EFontType` — публичный API, экспортируются из barrel `src/components/Typography/index.ts`. Изменение имён/значений — breaking change.
94
+ - **`TTextProps`**, **`ITypographyProps`** — публичные типы.
95
+ - **`displayName = "Text"`** — не убирать.
96
+ - Классы собираются только через `clsx`; порядок: `typography` → `text` → size → weight → line → type → decoration → `className`.
97
+ - `getTextDecorationClassName` (`utils.ts`) — внутренний хелпер семейства, через barrel не экспортируется и экспортироваться не должен.
98
+
99
+ ---
100
+
101
+ ## Accessibility
102
+
103
+ - Компонент не интерактивный: focus management и keyboard navigation не применимы.
104
+ - Семантика определяется потребителем через `tag`: по умолчанию нейтральный `<span>`; для абзаца передай `tag="p"`.
105
+ - Цвет (`type`) не передаёт семантику для screen reader'ов — статусные состояния (error/success) дублируй текстом или `aria`-атрибутами на уровне потребителя.
106
+
107
+ ---
108
+
109
+ ## Связанные компоненты
110
+
111
+ - `Title` — заголовки `h1`–`h3` на шрифте SBSansDisplay; общая палитра `EFontType` и decoration-props.
112
+ - `Caption` — мелкие подписи (C1/C2) и крупный показатель (D1).
113
+ - `CodeText` — моноширинный текст, фиксированный размер 14/20px, без props `size`/`weight`/`line`.
114
+
115
+ ---
116
+
117
+ ## Stories
118
+
119
+ Основные истории: `stories/Typography/Text.stories.tsx`
120
+ Файлы примеров: `stories/Typography/examples/Text/`
121
+
122
+ | Story | Example file | Что демонстрирует |
123
+ |---|---|---|
124
+ | `Playground` | `Playground.tsx` | Интерактивный контроль props `size`, `weight`, `line`, `type`, `tag`, `underline`, `strikethrough` |
125
+ | `Default` | `Default.tsx` | Минимальное использование: `size={ETextSize.B2}` |
126
+ | `Sizes` | `Sizes.tsx` | Все размеры B1–B4 |
127
+ | `Weights` | `Weights.tsx` | Начертания REGULAR / SEMIBOLD |
128
+ | `LineTypes` | `LineTypes.tsx` | Интерлиньяж NORMAL / COMPACT на размере B3 |
129
+ | `Types` | `Types.tsx` | Все 22 значения `EFontType`: базовые + инвертированные на тёмной подложке |
130
+ | `Decorations` | `Decorations.tsx` | `underline`, `strikethrough` и их комбинация |
131
+
132
+ ---
133
+
134
+ ## История изменений
135
+
136
+ | Дата | Изменение |
137
+ |---|---|
138
+ | 2026-07-20 | Создан документ. AI-рефакторинг: decoration-логика вынесена во внутренний хелпер `getTextDecorationClassName` (`utils.ts`), комментарии map-констант и членов enum переведены в JSDoc, unit-тесты расширены (все значения `ETextSize`/`EFontWeightText`/`ELineType`, дефолты). Stories переведены на modern pattern (`examples/Text/`). |
139
+
140
+ ---
141
+
142
+ ## Примеры использования
143
+
144
+ ### Default
145
+
146
+ `stories/Typography/examples/Text/Default.tsx`
147
+
148
+ ```tsx
149
+ import React from "react";
150
+ import { Text, ETextSize } from "@sberbusiness/triplex-next";
151
+
152
+ export const Default = () => <Text size={ETextSize.B2}>Основной текст интерфейса</Text>;
153
+ ```
154
+
155
+ ### Sizes
156
+
157
+ `stories/Typography/examples/Text/Sizes.tsx`
158
+
159
+ ```tsx
160
+ import React from "react";
161
+ import { Text, ETextSize } from "@sberbusiness/triplex-next";
162
+
163
+ export const Sizes = () => (
164
+ <div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
165
+ <Text size={ETextSize.B1}>B1 - Основной текст большого размера (18px)</Text>
166
+ <Text size={ETextSize.B2}>B2 - Основной текст среднего размера (16px)</Text>
167
+ <Text size={ETextSize.B3}>B3 - Основной текст малого размера (14px)</Text>
168
+ <Text size={ETextSize.B4}>B4 - Основной текст очень малого размера (12px)</Text>
169
+ </div>
170
+ );
171
+ ```
172
+
173
+ ### Weights
174
+
175
+ `stories/Typography/examples/Text/Weights.tsx`
176
+
177
+ ```tsx
178
+ import React from "react";
179
+ import { Text, ETextSize, EFontWeightText } from "@sberbusiness/triplex-next";
180
+
181
+ export const Weights = () => (
182
+ <div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
183
+ <Text size={ETextSize.B2} weight={EFontWeightText.REGULAR}>
184
+ Regular - Обычный вес текста
185
+ </Text>
186
+ <Text size={ETextSize.B2} weight={EFontWeightText.SEMIBOLD}>
187
+ Semibold - Полужирный текст
188
+ </Text>
189
+ </div>
190
+ );
191
+ ```
192
+
193
+ ### LineTypes
194
+
195
+ `stories/Typography/examples/Text/LineTypes.tsx`
196
+
197
+ ```tsx
198
+ import React from "react";
199
+ import { Text, ETextSize, ELineType } from "@sberbusiness/triplex-next";
200
+
201
+ export const LineTypes = () => (
202
+ <div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
203
+ <Text size={ETextSize.B3} line={ELineType.NORMAL}>
204
+ Normal - Обычная высота строки. Этот текст демонстрирует нормальную высоту строки для лучшей читаемости.
205
+ </Text>
206
+ <Text size={ETextSize.B3} line={ELineType.COMPACT}>
207
+ Compact - Компактная высота строки. Этот текст демонстрирует компактную высоту строки для экономии места.
208
+ </Text>
209
+ </div>
210
+ );
211
+ ```
212
+
213
+ ### Types
214
+
215
+ `stories/Typography/examples/Text/Types.tsx`
216
+
217
+ ```tsx
218
+ import React from "react";
219
+ import { Text, ETextSize, EFontType } from "@sberbusiness/triplex-next";
220
+
221
+ export const Types = () => (
222
+ <div style={{ display: "flex", gap: "16px" }}>
223
+ <div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
224
+ <Text size={ETextSize.B2} type={EFontType.PRIMARY}>
225
+ Primary
226
+ </Text>
227
+ <Text size={ETextSize.B2} type={EFontType.COMPLEMENTARY}>
228
+ Complementary
229
+ </Text>
230
+ <Text size={ETextSize.B2} type={EFontType.SECONDARY}>
231
+ Secondary
232
+ </Text>
233
+ <Text size={ETextSize.B2} type={EFontType.TERTIARY}>
234
+ Tertiary
235
+ </Text>
236
+ <Text size={ETextSize.B2} type={EFontType.BRAND}>
237
+ Brand
238
+ </Text>
239
+ <Text size={ETextSize.B2} type={EFontType.INFO}>
240
+ Info
241
+ </Text>
242
+ <Text size={ETextSize.B2} type={EFontType.SUCCESS}>
243
+ Success
244
+ </Text>
245
+ <Text size={ETextSize.B2} type={EFontType.WARNING}>
246
+ Warning
247
+ </Text>
248
+ <Text size={ETextSize.B2} type={EFontType.ERROR}>
249
+ Error
250
+ </Text>
251
+ <Text size={ETextSize.B2} type={EFontType.DISABLED}>
252
+ Disabled
253
+ </Text>
254
+ <Text size={ETextSize.B2} type={EFontType.SYSTEM}>
255
+ System
256
+ </Text>
257
+ </div>
258
+ <div style={{ display: "flex", flexDirection: "column", gap: "16px", backgroundColor: "#1F1F22" }}>
259
+ <Text size={ETextSize.B2} type={EFontType.PRIMARY_INVERT}>
260
+ Primary Invert
261
+ </Text>
262
+ <Text size={ETextSize.B2} type={EFontType.COMPLEMENTARY_INVERT}>
263
+ Complementary Invert
264
+ </Text>
265
+ <Text size={ETextSize.B2} type={EFontType.SECONDARY_INVERT}>
266
+ Secondary Invert
267
+ </Text>
268
+ <Text size={ETextSize.B2} type={EFontType.TERTIARY_INVERT}>
269
+ Tertiary Invert
270
+ </Text>
271
+ <Text size={ETextSize.B2} type={EFontType.BRAND_INVERT}>
272
+ Brand Invert
273
+ </Text>
274
+ <Text size={ETextSize.B2} type={EFontType.INFO_INVERT}>
275
+ Info Invert
276
+ </Text>
277
+ <Text size={ETextSize.B2} type={EFontType.SUCCESS_INVERT}>
278
+ Success Invert
279
+ </Text>
280
+ <Text size={ETextSize.B2} type={EFontType.WARNING_INVERT}>
281
+ Warning Invert
282
+ </Text>
283
+ <Text size={ETextSize.B2} type={EFontType.ERROR_INVERT}>
284
+ Error Invert
285
+ </Text>
286
+ <Text size={ETextSize.B2} type={EFontType.DISABLED_INVERT}>
287
+ Disabled Invert
288
+ </Text>
289
+ <Text size={ETextSize.B2} type={EFontType.SYSTEM_INVERT}>
290
+ System Invert
291
+ </Text>
292
+ </div>
293
+ </div>
294
+ );
295
+ ```
296
+
297
+ ### Decorations
298
+
299
+ `stories/Typography/examples/Text/Decorations.tsx`
300
+
301
+ ```tsx
302
+ import React from "react";
303
+ import { Text, ETextSize } from "@sberbusiness/triplex-next";
304
+
305
+ export const Decorations = () => (
306
+ <div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
307
+ <Text size={ETextSize.B2}>Текст без декораций</Text>
308
+ <Text size={ETextSize.B2} underline>
309
+ Текст с подчеркиванием
310
+ </Text>
311
+ <Text size={ETextSize.B2} strikethrough>
312
+ Текст с зачеркиванием
313
+ </Text>
314
+ <Text size={ETextSize.B2} underline strikethrough>
315
+ Текст с подчеркиванием и зачеркиванием
316
+ </Text>
317
+ </div>
318
+ );
319
+ ```
320
+