@sberbusiness/triplex-next-mcp-server 0.36.0-beta0 → 1.41.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 (46) hide show
  1. package/bundle/components/AlertContext.md +268 -0
  2. package/bundle/components/Button.md +5 -2
  3. package/bundle/components/ButtonDropdown.md +9 -1
  4. package/bundle/components/ButtonDropdownExtended.md +422 -0
  5. package/bundle/components/ButtonIcon.md +7 -1
  6. package/bundle/components/Calendar.md +183 -368
  7. package/bundle/components/Caption.md +291 -0
  8. package/bundle/components/Chip.md +310 -314
  9. package/bundle/components/CodeText.md +197 -0
  10. package/bundle/components/Col.md +311 -162
  11. package/bundle/components/CollapsibleTree.md +6 -3
  12. package/bundle/components/CollapsibleTreeExtended.md +6 -2
  13. package/bundle/components/Dropdown.md +748 -346
  14. package/bundle/components/FormField.md +468 -232
  15. package/bundle/components/IconWrapper.md +142 -89
  16. package/bundle/components/Island.md +221 -129
  17. package/bundle/components/KeyDownListener.md +215 -102
  18. package/bundle/components/LightBox.md +2252 -233
  19. package/bundle/components/List.md +26 -1
  20. package/bundle/components/ListActionItem.md +157 -0
  21. package/bundle/components/ListItem.md +34 -9
  22. package/bundle/components/ListItemSelectable.md +2 -2
  23. package/bundle/components/ListMaster.md +4 -5
  24. package/bundle/components/ListTableItem.md +391 -0
  25. package/bundle/components/LoaderMiddle.md +265 -0
  26. package/bundle/components/LoaderScreen.md +178 -81
  27. package/bundle/components/Notification.md +21 -21
  28. package/bundle/components/Page.md +1 -0
  29. package/bundle/components/Portal.md +131 -67
  30. package/bundle/components/Row.md +171 -69
  31. package/bundle/components/Text.md +320 -0
  32. package/bundle/components/TextField.md +364 -97
  33. package/bundle/components/ThemeProvider.md +305 -117
  34. package/bundle/components/Title.md +296 -0
  35. package/bundle/components/Tooltip.md +421 -181
  36. package/bundle/guides/commits.md +126 -24
  37. package/bundle/guides/context.md +1 -1
  38. package/bundle/guides/tests.md +42 -0
  39. package/bundle/manifest.json +109 -23
  40. package/bundle/release-notes/1.37.0.mdx +42 -1
  41. package/bundle/release-notes/1.38.0.mdx +36 -0
  42. package/bundle/release-notes/1.39.0.mdx +66 -0
  43. package/bundle/release-notes/1.40.0.mdx +27 -0
  44. package/bundle/release-notes/1.41.0.mdx +83 -0
  45. package/bundle/release-notes/1.42.0.mdx +7 -0
  46. package/package.json +1 -1
@@ -0,0 +1,197 @@
1
+ ---
2
+ component: CodeText
3
+ category: Typography
4
+ related: [Text, Title, Caption]
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/CodeText.stories.tsx
29
+ version: "1.0"
30
+ ---
31
+
32
+ # CodeText
33
+
34
+ ## Назначение
35
+
36
+ Моноширинный текст (типографика). Рендерит инлайновый `<span>` (тег настраивается через `tag`) со шрифтом SBSansTextMono и фиксированной типографикой 14/20px (font-weight 400). Размер и начертание не настраиваются — в отличие от остальных компонентов семейства.
37
+
38
+ Используй когда: нужно выровнять символы по ширине — фрагменты кода, номера счетов/договоров, ИНН/БИК, суммы в таблицах, технические идентификаторы.
39
+
40
+ Не используй когда:
41
+ - Нужен обычный пропорциональный текст — используй `Text`.
42
+ - Нужен другой размер моноширинного текста — в семействе его нет; не задавай `font-size` через `style`/`className`, обсуди расширение API с командой.
43
+
44
+ ---
45
+
46
+ ## Варианты и props
47
+
48
+ Собственных обязательных props нет. Компонент принимает только общие props типографики (`ITypographyProps`).
49
+
50
+ ### Опциональные props
51
+
52
+ | Prop | Тип | По умолчанию | Описание |
53
+ |---|---|---|---|
54
+ | `type` | `EFontType` | `PRIMARY` | Цвет текста из общей палитры типографики (11 базовых + 11 `*_INVERT`). |
55
+ | `underline` | `boolean` | — | Подчёркивание. Совместим со `strikethrough` (оба сразу — `underline line-through`). |
56
+ | `strikethrough` | `boolean` | — | Зачёркивание. |
57
+ | `tag` | `string` | `"span"` | HTML-тег корневого элемента (например, `code` для семантики фрагмента кода). |
58
+
59
+ Компонент типизирован как `TCodeTextProps<T extends keyof JSX.IntrinsicElements>` и принимает все атрибуты соответствующего HTML-элемента через spread.
60
+
61
+ ### Ограничения
62
+
63
+ - Props `size`, `weight`, `line` отсутствуют намеренно: типографика фиксирована (SBSansTextMono, 14/20px, 400).
64
+ - Внешний тип `forwardRef<HTMLElement, TCodeTextProps<keyof JSX.IntrinsicElements>>` «растворяет» дженерик: TypeScript не сужает атрибуты под конкретный `tag`. Известное ограничение публичного API, не исправлять без обсуждения (breaking).
65
+ - `EFontType.BRAND` дополнительно задаёт `user-select: none` (особенность стилей `Typography.module.less`).
66
+
67
+ ---
68
+
69
+ ## Дизайн-токены
70
+
71
+ Цвета — общие CSS-переменные семейства Typography (см. frontmatter): `--triplex-next-Typography-{Type}_Color` и `--triplex-next-Typography-{Type}Invert_Color`.
72
+
73
+ Шрифт и размер — фиксированные значения в `styles/CodeText.module.less` (токенов для них нет).
74
+
75
+ ---
76
+
77
+ ## Инварианты
78
+
79
+ - **`forwardRef`** — обязателен, `ref` пробрасывается на корневой элемент.
80
+ - **`TCodeTextProps`**, **`ITypographyProps`**, значения **`EFontType`** — публичный API из barrel. Изменение — breaking change.
81
+ - **`displayName = "CodeText"`** — не убирать.
82
+ - Фиксированная типографика (SBSansTextMono, 14/20px) — контракт компонента; добавление `size`/`weight` — расширение публичного API, требует обсуждения.
83
+ - Классы собираются только через `clsx`.
84
+
85
+ ---
86
+
87
+ ## Accessibility
88
+
89
+ - Компонент не интерактивный: focus management и keyboard navigation не применимы.
90
+ - По умолчанию рендерится нейтральный `<span>`; для семантики фрагмента кода передай `tag="code"`.
91
+ - Цвет (`type`) не передаёт семантику для screen reader'ов.
92
+
93
+ ---
94
+
95
+ ## Связанные компоненты
96
+
97
+ - `Text` — основной пропорциональный текст интерфейса (B1–B4).
98
+ - `Title` — заголовки `h1`–`h3`.
99
+ - `Caption` — мелкие подписи и крупный показатель D1.
100
+
101
+ ---
102
+
103
+ ## Stories
104
+
105
+ Основные истории: `stories/Typography/CodeText.stories.tsx`
106
+ Файлы примеров: `stories/Typography/examples/CodeText/`
107
+
108
+ | Story | Example file | Что демонстрирует |
109
+ |---|---|---|
110
+ | `Playground` | `Playground.tsx` | Интерактивный контроль props `type`, `tag`, `underline`, `strikethrough` |
111
+ | `Default` | `Default.tsx` | Минимальное использование |
112
+ | `Types` | `Types.tsx` | Все значения `EFontType`: базовые + инвертированные на тёмной подложке |
113
+ | `Decorations` | `Decorations.tsx` | `underline`, `strikethrough` и их комбинация |
114
+
115
+ ---
116
+
117
+ ## История изменений
118
+
119
+ | Дата | Изменение |
120
+ |---|---|
121
+ | 2026-07-20 | Создан документ. AI-рефакторинг: decoration-логика вынесена во внутренний хелпер `getTextDecorationClassName` (`utils.ts`), unit-тесты дополнены (дефолтный `type`, класс `brand`). Stories переведены на modern pattern (`examples/CodeText/`). |
122
+
123
+ ---
124
+
125
+ ## Примеры использования
126
+
127
+ ### Default
128
+
129
+ `stories/Typography/examples/CodeText/Default.tsx`
130
+
131
+ ```tsx
132
+ import React from "react";
133
+ import { CodeText } from "@sberbusiness/triplex-next";
134
+
135
+ export const Default = () => <CodeText>const greeting = &quot;Hello, World!&quot;;</CodeText>;
136
+ ```
137
+
138
+ ### Types
139
+
140
+ `stories/Typography/examples/CodeText/Types.tsx`
141
+
142
+ ```tsx
143
+ import React from "react";
144
+ import { CodeText, EFontType } from "@sberbusiness/triplex-next";
145
+
146
+ export const Types = () => (
147
+ <div style={{ display: "flex", gap: "16px" }}>
148
+ <div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
149
+ <CodeText type={EFontType.PRIMARY}>Primary</CodeText>
150
+ <CodeText type={EFontType.COMPLEMENTARY}>Complementary</CodeText>
151
+ <CodeText type={EFontType.SECONDARY}>Secondary</CodeText>
152
+ <CodeText type={EFontType.TERTIARY}>Tertiary</CodeText>
153
+ <CodeText type={EFontType.BRAND}>Brand</CodeText>
154
+ <CodeText type={EFontType.INFO}>Info</CodeText>
155
+ <CodeText type={EFontType.SUCCESS}>Success</CodeText>
156
+ <CodeText type={EFontType.WARNING}>Warning</CodeText>
157
+ <CodeText type={EFontType.ERROR}>Error</CodeText>
158
+ <CodeText type={EFontType.DISABLED}>Disabled</CodeText>
159
+ <CodeText type={EFontType.SYSTEM}>System</CodeText>
160
+ </div>
161
+ <div style={{ display: "flex", flexDirection: "column", gap: "16px", backgroundColor: "#1F1F22" }}>
162
+ <CodeText type={EFontType.PRIMARY_INVERT}>Primary Invert</CodeText>
163
+ <CodeText type={EFontType.COMPLEMENTARY_INVERT}>Complementary Invert</CodeText>
164
+ <CodeText type={EFontType.SECONDARY_INVERT}>Secondary Invert</CodeText>
165
+ <CodeText type={EFontType.TERTIARY_INVERT}>Tertiary Invert</CodeText>
166
+ <CodeText type={EFontType.BRAND_INVERT}>Brand Invert</CodeText>
167
+ <CodeText type={EFontType.INFO_INVERT}>Info Invert</CodeText>
168
+ <CodeText type={EFontType.SUCCESS_INVERT}>Success Invert</CodeText>
169
+ <CodeText type={EFontType.WARNING_INVERT}>Warning Invert</CodeText>
170
+ <CodeText type={EFontType.ERROR_INVERT}>Error Invert</CodeText>
171
+ <CodeText type={EFontType.DISABLED_INVERT}>Disabled Invert</CodeText>
172
+ <CodeText type={EFontType.SYSTEM_INVERT}>System Invert</CodeText>
173
+ </div>
174
+ </div>
175
+ );
176
+ ```
177
+
178
+ ### Decorations
179
+
180
+ `stories/Typography/examples/CodeText/Decorations.tsx`
181
+
182
+ ```tsx
183
+ import React from "react";
184
+ import { CodeText } from "@sberbusiness/triplex-next";
185
+
186
+ export const Decorations = () => (
187
+ <div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
188
+ <CodeText>const x = 42;</CodeText>
189
+ <CodeText underline>const x = 42; // с подчеркиванием</CodeText>
190
+ <CodeText strikethrough>const x = 42; // с зачеркиванием</CodeText>
191
+ <CodeText underline strikethrough>
192
+ const x = 42; // с подчеркиванием и зачеркиванием
193
+ </CodeText>
194
+ </div>
195
+ );
196
+ ```
197
+