@sberbusiness/triplex-next-mcp-server 0.24.0-beta1

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 (140) hide show
  1. package/README.md +124 -0
  2. package/bundle/.gitkeep +0 -0
  3. package/bundle/components/AbstractTree.md +198 -0
  4. package/bundle/components/AccordionBase.md +227 -0
  5. package/bundle/components/Alert.md +317 -0
  6. package/bundle/components/Amount.md +225 -0
  7. package/bundle/components/AmountField.md +289 -0
  8. package/bundle/components/Avatar.md +209 -0
  9. package/bundle/components/Badge.md +277 -0
  10. package/bundle/components/Body.md +167 -0
  11. package/bundle/components/Button.md +230 -0
  12. package/bundle/components/ButtonDropdown.md +159 -0
  13. package/bundle/components/ButtonIcon.md +122 -0
  14. package/bundle/components/Calendar.md +445 -0
  15. package/bundle/components/Card.md +374 -0
  16. package/bundle/components/CarouselExtended.md +250 -0
  17. package/bundle/components/Checkbox.md +126 -0
  18. package/bundle/components/CheckboxTree.md +280 -0
  19. package/bundle/components/CheckboxTreeExtended.md +321 -0
  20. package/bundle/components/CheckboxXGroup.md +68 -0
  21. package/bundle/components/CheckboxYGroup.md +67 -0
  22. package/bundle/components/Chip.md +404 -0
  23. package/bundle/components/ChipGroup.md +179 -0
  24. package/bundle/components/Col.md +221 -0
  25. package/bundle/components/CollapsableTree.md +255 -0
  26. package/bundle/components/Confirm.md +343 -0
  27. package/bundle/components/DateField.md +371 -0
  28. package/bundle/components/DatePickerExtended.md +342 -0
  29. package/bundle/components/DateRange.md +275 -0
  30. package/bundle/components/DesignTokens.md +385 -0
  31. package/bundle/components/Divider.md +196 -0
  32. package/bundle/components/DocumentNumberEdit.md +280 -0
  33. package/bundle/components/Dropdown.md +433 -0
  34. package/bundle/components/Ellipsis.md +208 -0
  35. package/bundle/components/EmptyView.md +99 -0
  36. package/bundle/components/ExpandAnimation.md +281 -0
  37. package/bundle/components/Footer.md +339 -0
  38. package/bundle/components/FormField.md +326 -0
  39. package/bundle/components/FormGroup.md +99 -0
  40. package/bundle/components/Gap.md +113 -0
  41. package/bundle/components/Header.md +280 -0
  42. package/bundle/components/HelpBox.md +154 -0
  43. package/bundle/components/IconWrapper.md +145 -0
  44. package/bundle/components/Island.md +197 -0
  45. package/bundle/components/IslandAccordion.md +230 -0
  46. package/bundle/components/IslandWidget.md +233 -0
  47. package/bundle/components/KeyDownListener.md +157 -0
  48. package/bundle/components/LightBox.md +322 -0
  49. package/bundle/components/Link.md +161 -0
  50. package/bundle/components/List.md +247 -0
  51. package/bundle/components/ListMaster.md +204 -0
  52. package/bundle/components/Loader.md +161 -0
  53. package/bundle/components/LoaderScreen.md +134 -0
  54. package/bundle/components/Marker.md +127 -0
  55. package/bundle/components/MarkerStatus.md +148 -0
  56. package/bundle/components/MediaWidth.md +169 -0
  57. package/bundle/components/MobileView.md +120 -0
  58. package/bundle/components/ModalWindow.md +308 -0
  59. package/bundle/components/MonthYearField.md +168 -0
  60. package/bundle/components/MultiselectField.md +213 -0
  61. package/bundle/components/Notification.md +233 -0
  62. package/bundle/components/NumberField.md +178 -0
  63. package/bundle/components/OrderedList.md +169 -0
  64. package/bundle/components/Overlay.md +237 -0
  65. package/bundle/components/Page.md +246 -0
  66. package/bundle/components/Pagination.md +298 -0
  67. package/bundle/components/Portal.md +119 -0
  68. package/bundle/components/Radio.md +174 -0
  69. package/bundle/components/Row.md +125 -0
  70. package/bundle/components/SMSField.md +160 -0
  71. package/bundle/components/SegmentedControl.md +235 -0
  72. package/bundle/components/SelectExtendedField.md +322 -0
  73. package/bundle/components/SelectField.md +213 -0
  74. package/bundle/components/Skeleton.md +129 -0
  75. package/bundle/components/Slider.md +157 -0
  76. package/bundle/components/SliderExtended.md +210 -0
  77. package/bundle/components/SliderRange.md +160 -0
  78. package/bundle/components/SmallInput.md +101 -0
  79. package/bundle/components/Spoiler.md +121 -0
  80. package/bundle/components/StatusTracker.md +151 -0
  81. package/bundle/components/Step.md +121 -0
  82. package/bundle/components/Stepper.md +163 -0
  83. package/bundle/components/Suggest.md +160 -0
  84. package/bundle/components/SuggestField.md +157 -0
  85. package/bundle/components/SwipeableArea.md +144 -0
  86. package/bundle/components/Table.md +199 -0
  87. package/bundle/components/Tabs.md +152 -0
  88. package/bundle/components/TabsExtended.md +273 -0
  89. package/bundle/components/TabsLine.md +189 -0
  90. package/bundle/components/Tag.md +135 -0
  91. package/bundle/components/TagColor.md +121 -0
  92. package/bundle/components/TagGroup.md +100 -0
  93. package/bundle/components/TextField.md +152 -0
  94. package/bundle/components/TextareaField.md +124 -0
  95. package/bundle/components/ThemeProvider.md +181 -0
  96. package/bundle/components/Tooltip.md +254 -0
  97. package/bundle/components/TopOverlay.md +145 -0
  98. package/bundle/components/TreeView.md +224 -0
  99. package/bundle/components/Triggers.md +121 -0
  100. package/bundle/guides/codestyle.md +205 -0
  101. package/bundle/guides/commits.md +166 -0
  102. package/bundle/guides/context.md +277 -0
  103. package/bundle/guides/stories.md +618 -0
  104. package/bundle/guides/template.md +154 -0
  105. package/bundle/guides/tests.md +301 -0
  106. package/bundle/icons.json +4156 -0
  107. package/bundle/manifest.json +796 -0
  108. package/bundle/release-notes/1.1.0.mdx +26 -0
  109. package/bundle/release-notes/1.1.1.mdx +14 -0
  110. package/bundle/release-notes/1.10.0.mdx +43 -0
  111. package/bundle/release-notes/1.11.0.mdx +19 -0
  112. package/bundle/release-notes/1.12.0.mdx +21 -0
  113. package/bundle/release-notes/1.13.0.mdx +43 -0
  114. package/bundle/release-notes/1.14.0.mdx +29 -0
  115. package/bundle/release-notes/1.15.0.mdx +56 -0
  116. package/bundle/release-notes/1.16.0.mdx +55 -0
  117. package/bundle/release-notes/1.17.0.mdx +15 -0
  118. package/bundle/release-notes/1.18.0.mdx +24 -0
  119. package/bundle/release-notes/1.19.0.mdx +48 -0
  120. package/bundle/release-notes/1.19.1.mdx +9 -0
  121. package/bundle/release-notes/1.2.0.mdx +80 -0
  122. package/bundle/release-notes/1.20.0.mdx +48 -0
  123. package/bundle/release-notes/1.21.0.mdx +66 -0
  124. package/bundle/release-notes/1.22.0.mdx +75 -0
  125. package/bundle/release-notes/1.23.0.mdx +50 -0
  126. package/bundle/release-notes/1.24.0.mdx +59 -0
  127. package/bundle/release-notes/1.25.0.mdx +52 -0
  128. package/bundle/release-notes/1.26.0.mdx +11 -0
  129. package/bundle/release-notes/1.3.0.mdx +21 -0
  130. package/bundle/release-notes/1.4.0.mdx +37 -0
  131. package/bundle/release-notes/1.5.0.mdx +24 -0
  132. package/bundle/release-notes/1.6.0.mdx +37 -0
  133. package/bundle/release-notes/1.6.1.mdx +11 -0
  134. package/bundle/release-notes/1.7.0.mdx +29 -0
  135. package/bundle/release-notes/1.8.0.mdx +38 -0
  136. package/bundle/release-notes/1.9.0.mdx +28 -0
  137. package/dist/index.d.ts +2 -0
  138. package/dist/index.js +324 -0
  139. package/dist/index.js.map +1 -0
  140. package/package.json +51 -0
@@ -0,0 +1,159 @@
1
+ ---
2
+ component: ButtonDropdown
3
+ category: Buttons
4
+ figma-node: ""
5
+ figma-file: ""
6
+ related: [Button, ButtonDropdownExtended, Dropdown]
7
+ tokens: []
8
+ stories: stories/Buttons/ButtonDropdown.stories.tsx
9
+ version: "1.0"
10
+ ---
11
+
12
+ # ButtonDropdown
13
+
14
+ ## Назначение
15
+
16
+ Кнопка-триггер с выпадающим списком действий.
17
+ Поддерживает два визуальных режима: обычная кнопка (`EButtonTheme`) и dots-вариант (`EButtonDotsTheme`).
18
+
19
+ Используй когда: нужно сгруппировать несколько действий под один триггер и дать выбор опции из списка.
20
+ Не используй когда: нужна одиночная кнопка без списка - используй `Button`.
21
+
22
+ ---
23
+
24
+ ## Файловая структура
25
+
26
+ ```text
27
+ src/components/Button/
28
+ ├── ButtonDropdown.tsx # Основной компонент (forwardRef, рендер button + dropdown)
29
+ ├── ButtonDropdownExtended.tsx # Базовый контейнер с контролем opened/close и outside click
30
+ ├── styles/
31
+ │ ├── ButtonDropdown.module.less # Стили caret, active-состояния, block-режима
32
+ │ └── ButtonDropdownExtended.module.less
33
+ └── index.ts # Публичный экспорт ButtonDropdown
34
+ ```
35
+
36
+ ---
37
+
38
+ ## Варианты и props
39
+
40
+ ### Обязательные props
41
+
42
+ | Prop | Тип | Описание |
43
+ |---|---|---|
44
+ | `theme` | `EButtonTheme.GENERAL \| EButtonTheme.SECONDARY \| EButtonTheme.SECONDARY_LIGHT \| EButtonTheme.DANGER \| EButtonDotsTheme` | Визуальная тема триггера |
45
+ | `size` | `EComponentSize` | Размер кнопки (`SM` / `MD` / `LG`) |
46
+ | `options` | `IButtonDropdownOption[]` | Опции выпадающего списка |
47
+
48
+ ### Опциональные props
49
+
50
+ | Prop | Тип | По умолчанию | Описание |
51
+ |---|---|---|---|
52
+ | `children` | `React.ReactNode` | `undefined` | Текст/контент кнопки (используется также в mobile header) |
53
+ | `selected` | `IButtonDropdownOption` | `undefined` | Предвыбранная опция для подсветки в списке |
54
+ | `disabled` | `boolean` | `false` | Блокирует кнопку и открытие списка |
55
+ | `buttonAttributes` | `React.ButtonHTMLAttributes<HTMLButtonElement>` | `undefined` | Дополнительные HTML-атрибуты нативной кнопки |
56
+ | `block` | `boolean` | `false` | Доступен только для non-dots тем |
57
+ | `className` | `string` | — | Дополнительный CSS-класс контейнера |
58
+ | `...rest` | `React.HTMLAttributes<HTMLDivElement>` | — | Атрибуты корневого `div` компонента |
59
+
60
+ ### Ограничения по темам
61
+
62
+ - Для `EButtonDotsTheme` prop `block` запрещен типизацией (`never`).
63
+ - Dots-режим использует иконку `Dotshorizontal*` вместо текстового контента кнопки.
64
+
65
+ ### Структура опции (`IButtonDropdownOption`)
66
+
67
+ | Поле | Тип | Описание |
68
+ |---|---|---|
69
+ | `id` | `string` | Уникальный идентификатор опции |
70
+ | `label` | `React.ReactNode` | Видимый контент пункта меню |
71
+ | `onSelect` | `() => void` | Callback выбора опции |
72
+ | `...rest` | `IDropdownListItemProps` (без ряда запрещенных полей) | Остальные настройки `DropdownList.Item` |
73
+
74
+ ---
75
+
76
+ ## Ключевые особенности реализации
77
+
78
+ ### Композиция через `ButtonDropdownExtended`
79
+
80
+ - `ButtonDropdown` делегирует управление opened-state и close-on-outside в `ButtonDropdownExtended`.
81
+ - Передает две render-функции: `renderButton` и `renderDropdown`.
82
+
83
+ ### Desktop + mobile dropdown
84
+
85
+ - Desktop: рендерится `DropdownList` с `DropdownList.Item`.
86
+ - Mobile: через `mobileViewProps` рендерится `DropdownMobileHeader` + `DropdownMobileList`.
87
+ - После выбора любого пункта вызывается `option.onSelect?.()` и dropdown закрывается.
88
+
89
+ ### Управление клавиатурой
90
+
91
+ - На кнопке перехватываются `Space`, `ArrowUp`, `ArrowDown` с `preventDefault`.
92
+ - `ArrowUp/ArrowDown` открывают dropdown, если он закрыт.
93
+ - В `ButtonDropdownExtended` dropdown закрывается по `Escape` и (из-за `closeOnTab`) по `Tab`.
94
+
95
+ ### ARIA-связка trigger/list
96
+
97
+ - Кнопка получает `aria-haspopup="menu"`, `aria-expanded`, `aria-controls`.
98
+ - `aria-controls` и `DropdownList` связываются через `instanceId` (`uniqueId()`).
99
+ - `aria-activedescendant` синхронизируется через `DropdownListContext`.
100
+
101
+ ---
102
+
103
+ ## Accessibility
104
+
105
+ - Триггер строится на `Button` (нативный `button`), базовая keyboard-навигация сохраняется.
106
+ - Компонент не хардкодит aria-тексты: при необходимости `aria-label` нужно передавать через `buttonAttributes`.
107
+ - На mobile-заголовке dropdown отображается `children` триггера; если в продукте нужен локализованный отдельный заголовок, его нужно задавать на уровне композиции (через `ButtonDropdownExtended`).
108
+ - Для корректной доступности меню потребитель должен передавать понятные `label` для `options`.
109
+
110
+ ---
111
+
112
+ ## Дизайн-токены
113
+
114
+ `ButtonDropdown` не использует собственных CSS color-токенов в `ButtonDropdown.module.less`.
115
+ Визуальные токены берутся из `Button` и `Dropdown`, которые рендерятся внутри.
116
+
117
+ ---
118
+
119
+ ## Инварианты
120
+
121
+ - `forwardRef` на `ButtonDropdown` обязателен: ref должен оставаться на `HTMLButtonElement` триггера.
122
+ - `IButtonDropdownOption.id` должен оставаться обязательным и уникальным ключом для рендера списков.
123
+ - `closeOnTab` в вызове `ButtonDropdownExtended` должен сохраняться (часть текущего UX-контракта закрытия).
124
+ - Выбор опции должен закрывать dropdown и на desktop, и на mobile.
125
+ - Публичный экспорт из `src/components/Button/index.ts` должен оставаться.
126
+
127
+ ---
128
+
129
+ ## Связанные компоненты
130
+
131
+ - `Button` (`src/components/Button/Button.tsx`) - базовый триггер, на котором построен `ButtonDropdown`.
132
+ - `ButtonDropdownExtended` (`src/components/Button/ButtonDropdownExtended.tsx`) - управляет открытием/закрытием dropdown.
133
+ - `Dropdown` (`src/components/Dropdown`) - контейнер и пункты списка для desktop/mobile представления.
134
+
135
+ ---
136
+
137
+ ## Stories
138
+
139
+ `stories/Buttons/ButtonDropdown.stories.tsx`
140
+ Файлы примеров: `stories/Buttons/examples/ButtonDropdown/`
141
+
142
+ | Story | Example file | Что демонстрирует |
143
+ |---|---|---|
144
+ | `Playground` | `PlaygroundExample.tsx` | Интерактивный контроль `children`, `theme`, `size`, `block`, `disabled` |
145
+ | `Default` | `DefaultExample.tsx` | Базовый сценарий открытия и выбора опций |
146
+ | `Sizes` | `SizesExample.tsx` | Размеры `SM` / `MD` / `LG` |
147
+ | `Themes` | `ThemesExample.tsx` | Разные темы (`EButtonTheme` + `EButtonDotsTheme`) |
148
+ | `BlockMode` | `BlockModeExample.tsx` | Блочный режим non-dots кнопки |
149
+ | `Disabled` | `DisabledExample.tsx` | Неактивное состояние |
150
+ | `WithSelectedOption` | `WithSelectedOptionExample.tsx` | Предвыбранная опция через `selected` |
151
+ | `VisualTests` | `VisualTestsExample.tsx` | Сценарий визуальной регрессии |
152
+
153
+ ---
154
+
155
+ ## История изменений
156
+
157
+ | Дата | Изменение |
158
+ |---|---|
159
+ | 2026-04-15 | Создан документ AI-ready для `ButtonDropdown`. |
@@ -0,0 +1,122 @@
1
+ ---
2
+ component: ButtonIcon
3
+ category: Buttons
4
+ figma-node: ""
5
+ figma-file: ""
6
+ related: [Button]
7
+ tokens:
8
+ - --triplex-next-Button-Icon_Shadow_Focus
9
+ stories: stories/Buttons/ButtonIcon.stories.tsx
10
+ version: "1.0"
11
+ ---
12
+
13
+ # ButtonIcon
14
+
15
+ ## Назначение
16
+
17
+ Кнопка только с иконкой без текстового контента. Используется как компактный trigger для локальных действий (например, открыть меню, удалить, закрыть).
18
+
19
+ Используй когда: действие можно однозначно распознать по иконке и есть корректный `aria-label`.
20
+ Не используй когда: нужен текстовый CTA или несколько визуальных тем с размерами как у `Button` - используй `Button`.
21
+
22
+ ---
23
+
24
+ ## Файловая структура
25
+
26
+ ```text
27
+ src/components/Button/
28
+ ├── ButtonIcon.tsx # Компонент (forwardRef, native button)
29
+ ├── enums.ts # EButtonIconShape (SQUIRCLE / CIRCLE)
30
+ └── styles/
31
+ └── ButtonIcon.module.less # Геометрия, focus-visible, базовые состояния
32
+ ```
33
+
34
+ ---
35
+
36
+ ## Варианты и props
37
+
38
+ ### Обязательные props
39
+
40
+ Обязательных custom-props нет.
41
+
42
+ ### Опциональные props
43
+
44
+ | Prop | Тип | По умолчанию | Описание |
45
+ |---|---|---|---|
46
+ | `shape` | `EButtonIconShape` | `SQUIRCLE` | Форма кнопки: `SQUIRCLE` (радиус 4px) или `CIRCLE` (радиус 50%) |
47
+ | `active` | `boolean` | `false` | Визуально активное состояние |
48
+ | `className` | `string` | — | Дополнительный CSS-класс |
49
+ | `...rest` | `React.ButtonHTMLAttributes<HTMLButtonElement> & DataAttributes` | — | Нативные атрибуты `<button>`, включая `disabled`, `aria-*`, `data-*` |
50
+
51
+ ### Ограничения использования
52
+
53
+ - Размер `ButtonIcon` задаётся размером переданной иконки; у компонента нет собственного prop `size`.
54
+ - Корневой DOM-элемент всегда `button`, `type` по умолчанию принудительно установлен в `button`.
55
+
56
+ ---
57
+
58
+ ## Ключевые особенности реализации
59
+
60
+ ### Маппинг формы через enum
61
+
62
+ - `shape` маппится в CSS-класс через `Record<EButtonIconShape, string>`.
63
+ - При расширении `EButtonIconShape` нужно добавить класс в маппинг и в `ButtonIcon.module.less`.
64
+
65
+ ### Визуальные состояния
66
+
67
+ - `active` и `disabled` добавляются как глобальные CSS-классы (`active`, `disabled`) для совместимости с иконками.
68
+ - Дополнительно всегда добавляется класс `hoverable`.
69
+
70
+ ---
71
+
72
+ ## Accessibility
73
+
74
+ - Компонент рендерит нативный `<button>`, поэтому базовая keyboard-навигация доступна из коробки.
75
+ - Компонент **не хардкодит** `aria-label` (библиотека мультиязычная). Для иконки без текста потребитель обязан передать `aria-label` через `...rest`.
76
+ - Фокусное состояние реализовано через `:focus-visible` и токен `--triplex-next-Button-Icon_Shadow_Focus`.
77
+
78
+ ---
79
+
80
+ ## Дизайн-токены
81
+
82
+ ```
83
+ --triplex-next-Button-Icon_Shadow_Focus
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Инварианты
89
+
90
+ - `forwardRef` обязателен: ref должен оставаться на `HTMLButtonElement`.
91
+ - `type="button"` должен оставаться дефолтом, чтобы не триггерить submit в формах по умолчанию.
92
+ - `shape` по умолчанию должен оставаться `EButtonIconShape.SQUIRCLE`.
93
+ - Публичный экспорт `ButtonIcon` из `src/components/Button/index.ts` должен сохраняться.
94
+
95
+ ---
96
+
97
+ ## Связанные компоненты
98
+
99
+ - `Button` (`src/components/Button/Button.tsx`) - текстовая/универсальная кнопка, используемая вместо `ButtonIcon` когда нужен label.
100
+ - `ButtonDropdown` (`src/components/Button/ButtonDropdown.tsx`) - использует иконочный паттерн для dots-варианта trigger.
101
+
102
+ ---
103
+
104
+ ## Stories
105
+
106
+ `stories/Buttons/ButtonIcon.stories.tsx`
107
+ Файлы примеров: `stories/Buttons/examples/ButtonIcon/`
108
+
109
+ | Story | Example file | Что демонстрирует |
110
+ |---|---|---|
111
+ | `Playground` | `PlaygroundExample.tsx` | Интерактивный контроль `shape`, `active`, `disabled` |
112
+ | `Default` | `DefaultExample.tsx` | Базовый сценарий использования |
113
+ | `Sizes` | `SizesExample.tsx` | Разные размеры через размер иконки (16/20/24/32) |
114
+ | `Disabled` | `DisabledExample.tsx` | Неактивное состояние |
115
+
116
+ ---
117
+
118
+ ## История изменений
119
+
120
+ | Дата | Изменение |
121
+ |---|---|
122
+ | 2026-04-15 | Создан документ AI-ready для `ButtonIcon`. |