@sberbusiness/triplex-next-mcp-server 0.24.0-beta1 → 0.24.0-beta2
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/bundle/components/Alert.md +272 -0
- package/bundle/components/Amount.md +138 -0
- package/bundle/components/AmountField.md +174 -0
- package/bundle/components/Avatar.md +72 -0
- package/bundle/components/Badge.md +203 -0
- package/bundle/components/Button.md +280 -0
- package/bundle/components/ButtonDropdown.md +300 -0
- package/bundle/components/ButtonIcon.md +69 -0
- package/bundle/components/Calendar.md +58 -0
- package/bundle/components/Checkbox.md +112 -0
- package/bundle/components/CheckboxTree.md +61 -0
- package/bundle/components/CheckboxTreeExtended.md +114 -0
- package/bundle/components/CheckboxXGroup.md +41 -0
- package/bundle/components/CheckboxYGroup.md +45 -0
- package/bundle/components/EmptyView.md +119 -0
- package/bundle/components/HelpBox.md +198 -0
- package/bundle/components/SliderExtended.md +285 -0
- package/bundle/manifest.json +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -157,3 +157,303 @@ src/components/Button/
|
|
|
157
157
|
| Дата | Изменение |
|
|
158
158
|
|---|---|
|
|
159
159
|
| 2026-04-15 | Создан документ AI-ready для `ButtonDropdown`. |
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Примеры использования
|
|
164
|
+
|
|
165
|
+
### Default
|
|
166
|
+
|
|
167
|
+
`stories/Buttons/examples/ButtonDropdown/DefaultExample.tsx`
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
import React from "react";
|
|
171
|
+
import { ButtonDropdown, EButtonTheme, EComponentSize, IButtonDropdownOption } from "@sberbusiness/triplex-next";
|
|
172
|
+
|
|
173
|
+
const OPTIONS: IButtonDropdownOption[] = [
|
|
174
|
+
{ id: "opt-1", label: "Действие 1", onSelect: () => undefined },
|
|
175
|
+
{ id: "opt-2", label: "Действие 2", onSelect: () => undefined },
|
|
176
|
+
{ id: "opt-3", label: "Действие 3", onSelect: () => undefined },
|
|
177
|
+
];
|
|
178
|
+
|
|
179
|
+
export const DefaultExample = () => (
|
|
180
|
+
<div style={{ width: 280 }}>
|
|
181
|
+
<ButtonDropdown theme={EButtonTheme.GENERAL} size={EComponentSize.MD} options={OPTIONS}>
|
|
182
|
+
Button text
|
|
183
|
+
</ButtonDropdown>
|
|
184
|
+
</div>
|
|
185
|
+
);
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Sizes
|
|
189
|
+
|
|
190
|
+
`stories/Buttons/examples/ButtonDropdown/SizesExample.tsx`
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
import React from "react";
|
|
194
|
+
import {
|
|
195
|
+
ButtonDropdown,
|
|
196
|
+
EButtonDotsTheme,
|
|
197
|
+
EButtonTheme,
|
|
198
|
+
EComponentSize,
|
|
199
|
+
IButtonDropdownOption,
|
|
200
|
+
} from "@sberbusiness/triplex-next";
|
|
201
|
+
|
|
202
|
+
const OPTIONS: IButtonDropdownOption[] = [
|
|
203
|
+
{ id: "opt-1", label: "Действие 1", onSelect: () => undefined },
|
|
204
|
+
{ id: "opt-2", label: "Действие 2", onSelect: () => undefined },
|
|
205
|
+
{ id: "opt-3", label: "Действие 3", onSelect: () => undefined },
|
|
206
|
+
];
|
|
207
|
+
|
|
208
|
+
export const SizesExample = () => (
|
|
209
|
+
<div style={{ display: "flex", flexDirection: "column", gap: 16 }}>
|
|
210
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "8px" }}>
|
|
211
|
+
<div style={{ marginBottom: "8px", fontSize: "16px", fontWeight: "700" }}>SM</div>
|
|
212
|
+
<div style={{ display: "flex", flexWrap: "wrap", alignItems: "center", gap: 16 }}>
|
|
213
|
+
<ButtonDropdown size={EComponentSize.SM} theme={EButtonTheme.GENERAL} options={OPTIONS}>
|
|
214
|
+
Button text
|
|
215
|
+
</ButtonDropdown>
|
|
216
|
+
<ButtonDropdown size={EComponentSize.SM} theme={EButtonTheme.SECONDARY} options={OPTIONS}>
|
|
217
|
+
Button text
|
|
218
|
+
</ButtonDropdown>
|
|
219
|
+
<ButtonDropdown size={EComponentSize.SM} theme={EButtonTheme.SECONDARY_LIGHT} options={OPTIONS}>
|
|
220
|
+
Button text
|
|
221
|
+
</ButtonDropdown>
|
|
222
|
+
<ButtonDropdown size={EComponentSize.SM} theme={EButtonTheme.DANGER} options={OPTIONS}>
|
|
223
|
+
Button text
|
|
224
|
+
</ButtonDropdown>
|
|
225
|
+
<ButtonDropdown size={EComponentSize.SM} theme={EButtonDotsTheme.DOTS_SECONDARY} options={OPTIONS}>
|
|
226
|
+
Button text
|
|
227
|
+
</ButtonDropdown>
|
|
228
|
+
<ButtonDropdown
|
|
229
|
+
size={EComponentSize.SM}
|
|
230
|
+
theme={EButtonDotsTheme.DOTS_SECONDARY_LIGHT}
|
|
231
|
+
options={OPTIONS}
|
|
232
|
+
>
|
|
233
|
+
Button text
|
|
234
|
+
</ButtonDropdown>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "8px" }}>
|
|
238
|
+
<div style={{ marginBottom: "8px", fontSize: "16px", fontWeight: "700" }}>MD</div>
|
|
239
|
+
<div style={{ display: "flex", flexWrap: "wrap", alignItems: "center", gap: 16 }}>
|
|
240
|
+
<ButtonDropdown size={EComponentSize.MD} theme={EButtonTheme.GENERAL} options={OPTIONS}>
|
|
241
|
+
Button text
|
|
242
|
+
</ButtonDropdown>
|
|
243
|
+
<ButtonDropdown size={EComponentSize.MD} theme={EButtonTheme.SECONDARY} options={OPTIONS}>
|
|
244
|
+
Button text
|
|
245
|
+
</ButtonDropdown>
|
|
246
|
+
<ButtonDropdown size={EComponentSize.MD} theme={EButtonTheme.SECONDARY_LIGHT} options={OPTIONS}>
|
|
247
|
+
Button text
|
|
248
|
+
</ButtonDropdown>
|
|
249
|
+
<ButtonDropdown size={EComponentSize.MD} theme={EButtonTheme.DANGER} options={OPTIONS}>
|
|
250
|
+
Button text
|
|
251
|
+
</ButtonDropdown>
|
|
252
|
+
<ButtonDropdown size={EComponentSize.MD} theme={EButtonDotsTheme.DOTS_SECONDARY} options={OPTIONS}>
|
|
253
|
+
Button text
|
|
254
|
+
</ButtonDropdown>
|
|
255
|
+
<ButtonDropdown
|
|
256
|
+
size={EComponentSize.MD}
|
|
257
|
+
theme={EButtonDotsTheme.DOTS_SECONDARY_LIGHT}
|
|
258
|
+
options={OPTIONS}
|
|
259
|
+
>
|
|
260
|
+
Button text
|
|
261
|
+
</ButtonDropdown>
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "8px" }}>
|
|
265
|
+
<div style={{ marginBottom: "8px", fontSize: "16px", fontWeight: "700" }}>LG</div>
|
|
266
|
+
<div style={{ display: "flex", flexWrap: "wrap", alignItems: "center", gap: 16 }}>
|
|
267
|
+
<ButtonDropdown size={EComponentSize.LG} theme={EButtonTheme.GENERAL} options={OPTIONS}>
|
|
268
|
+
Button text
|
|
269
|
+
</ButtonDropdown>
|
|
270
|
+
<ButtonDropdown size={EComponentSize.LG} theme={EButtonTheme.SECONDARY} options={OPTIONS}>
|
|
271
|
+
Button text
|
|
272
|
+
</ButtonDropdown>
|
|
273
|
+
<ButtonDropdown size={EComponentSize.LG} theme={EButtonTheme.SECONDARY_LIGHT} options={OPTIONS}>
|
|
274
|
+
Button text
|
|
275
|
+
</ButtonDropdown>
|
|
276
|
+
<ButtonDropdown size={EComponentSize.LG} theme={EButtonTheme.DANGER} options={OPTIONS}>
|
|
277
|
+
Button text
|
|
278
|
+
</ButtonDropdown>
|
|
279
|
+
<ButtonDropdown size={EComponentSize.LG} theme={EButtonDotsTheme.DOTS_SECONDARY} options={OPTIONS}>
|
|
280
|
+
Button text
|
|
281
|
+
</ButtonDropdown>
|
|
282
|
+
<ButtonDropdown
|
|
283
|
+
size={EComponentSize.LG}
|
|
284
|
+
theme={EButtonDotsTheme.DOTS_SECONDARY_LIGHT}
|
|
285
|
+
options={OPTIONS}
|
|
286
|
+
>
|
|
287
|
+
Button text
|
|
288
|
+
</ButtonDropdown>
|
|
289
|
+
</div>
|
|
290
|
+
</div>
|
|
291
|
+
</div>
|
|
292
|
+
);
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Themes
|
|
296
|
+
|
|
297
|
+
`stories/Buttons/examples/ButtonDropdown/ThemesExample.tsx`
|
|
298
|
+
|
|
299
|
+
```tsx
|
|
300
|
+
import React from "react";
|
|
301
|
+
import {
|
|
302
|
+
ButtonDropdown,
|
|
303
|
+
EButtonDotsTheme,
|
|
304
|
+
EButtonTheme,
|
|
305
|
+
EComponentSize,
|
|
306
|
+
IButtonDropdownOption,
|
|
307
|
+
} from "@sberbusiness/triplex-next";
|
|
308
|
+
|
|
309
|
+
const OPTIONS: IButtonDropdownOption[] = [
|
|
310
|
+
{ id: "opt-1", label: "Действие 1", onSelect: () => undefined },
|
|
311
|
+
{ id: "opt-2", label: "Действие 2", onSelect: () => undefined },
|
|
312
|
+
{ id: "opt-3", label: "Действие 3", onSelect: () => undefined },
|
|
313
|
+
];
|
|
314
|
+
|
|
315
|
+
export const ThemesExample = () => (
|
|
316
|
+
<div style={{ display: "flex", flexDirection: "column", gap: 16 }}>
|
|
317
|
+
<div style={{ display: "flex", flexWrap: "wrap", alignItems: "center", gap: 16 }}>
|
|
318
|
+
<ButtonDropdown theme={EButtonTheme.GENERAL} size={EComponentSize.MD} options={OPTIONS}>
|
|
319
|
+
General
|
|
320
|
+
</ButtonDropdown>
|
|
321
|
+
<ButtonDropdown theme={EButtonTheme.SECONDARY} size={EComponentSize.MD} options={OPTIONS}>
|
|
322
|
+
Secondary
|
|
323
|
+
</ButtonDropdown>
|
|
324
|
+
<ButtonDropdown theme={EButtonTheme.SECONDARY_LIGHT} size={EComponentSize.MD} options={OPTIONS}>
|
|
325
|
+
Secondary Light
|
|
326
|
+
</ButtonDropdown>
|
|
327
|
+
<ButtonDropdown theme={EButtonTheme.DANGER} size={EComponentSize.MD} options={OPTIONS}>
|
|
328
|
+
Danger
|
|
329
|
+
</ButtonDropdown>
|
|
330
|
+
</div>
|
|
331
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "8px" }}>
|
|
332
|
+
<div style={{ marginBottom: "8px", fontSize: "16px", fontWeight: "700" }}>DOTS_SECONDARY</div>
|
|
333
|
+
<ButtonDropdown theme={EButtonDotsTheme.DOTS_SECONDARY} size={EComponentSize.MD} options={OPTIONS}>
|
|
334
|
+
Dots Secondary
|
|
335
|
+
</ButtonDropdown>
|
|
336
|
+
</div>
|
|
337
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "8px" }}>
|
|
338
|
+
<div style={{ marginBottom: "8px", fontSize: "16px", fontWeight: "700" }}>DOTS_SECONDARY_LIGHT</div>
|
|
339
|
+
<ButtonDropdown theme={EButtonDotsTheme.DOTS_SECONDARY_LIGHT} size={EComponentSize.MD} options={OPTIONS}>
|
|
340
|
+
Dots Secondary Light
|
|
341
|
+
</ButtonDropdown>
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
344
|
+
);
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### BlockMode
|
|
348
|
+
|
|
349
|
+
`stories/Buttons/examples/ButtonDropdown/BlockModeExample.tsx`
|
|
350
|
+
|
|
351
|
+
```tsx
|
|
352
|
+
import React from "react";
|
|
353
|
+
import { ButtonDropdown, EButtonTheme, EComponentSize, Gap, IButtonDropdownOption } from "@sberbusiness/triplex-next";
|
|
354
|
+
|
|
355
|
+
const OPTIONS: IButtonDropdownOption[] = [
|
|
356
|
+
{ id: "opt-1", label: "Действие 1", onSelect: () => undefined },
|
|
357
|
+
{ id: "opt-2", label: "Действие 2", onSelect: () => undefined },
|
|
358
|
+
{ id: "opt-3", label: "Действие 3", onSelect: () => undefined },
|
|
359
|
+
];
|
|
360
|
+
|
|
361
|
+
export const BlockModeExample = () => (
|
|
362
|
+
<div style={{ maxWidth: 280 }}>
|
|
363
|
+
<ButtonDropdown block theme={EButtonTheme.GENERAL} size={EComponentSize.MD} options={OPTIONS}>
|
|
364
|
+
Button text
|
|
365
|
+
</ButtonDropdown>
|
|
366
|
+
<Gap size={16} />
|
|
367
|
+
<ButtonDropdown block theme={EButtonTheme.SECONDARY} size={EComponentSize.MD} options={OPTIONS}>
|
|
368
|
+
Button text
|
|
369
|
+
</ButtonDropdown>
|
|
370
|
+
<Gap size={16} />
|
|
371
|
+
<ButtonDropdown block theme={EButtonTheme.SECONDARY_LIGHT} size={EComponentSize.MD} options={OPTIONS}>
|
|
372
|
+
Button text
|
|
373
|
+
</ButtonDropdown>
|
|
374
|
+
<Gap size={16} />
|
|
375
|
+
<ButtonDropdown block theme={EButtonTheme.DANGER} size={EComponentSize.MD} options={OPTIONS}>
|
|
376
|
+
Button text
|
|
377
|
+
</ButtonDropdown>
|
|
378
|
+
</div>
|
|
379
|
+
);
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### Disabled
|
|
383
|
+
|
|
384
|
+
`stories/Buttons/examples/ButtonDropdown/DisabledExample.tsx`
|
|
385
|
+
|
|
386
|
+
```tsx
|
|
387
|
+
import React from "react";
|
|
388
|
+
import {
|
|
389
|
+
ButtonDropdown,
|
|
390
|
+
EButtonDotsTheme,
|
|
391
|
+
EButtonTheme,
|
|
392
|
+
EComponentSize,
|
|
393
|
+
IButtonDropdownOption,
|
|
394
|
+
} from "@sberbusiness/triplex-next";
|
|
395
|
+
|
|
396
|
+
const OPTIONS: IButtonDropdownOption[] = [
|
|
397
|
+
{ id: "opt-1", label: "Действие 1", onSelect: () => undefined },
|
|
398
|
+
{ id: "opt-2", label: "Действие 2", onSelect: () => undefined },
|
|
399
|
+
{ id: "opt-3", label: "Действие 3", onSelect: () => undefined },
|
|
400
|
+
];
|
|
401
|
+
|
|
402
|
+
export const DisabledExample = () => (
|
|
403
|
+
<div style={{ display: "flex", flexWrap: "wrap", alignItems: "center", gap: 16 }}>
|
|
404
|
+
<ButtonDropdown disabled theme={EButtonTheme.GENERAL} size={EComponentSize.MD} options={OPTIONS}>
|
|
405
|
+
Button text
|
|
406
|
+
</ButtonDropdown>
|
|
407
|
+
<ButtonDropdown disabled theme={EButtonTheme.SECONDARY} size={EComponentSize.MD} options={OPTIONS}>
|
|
408
|
+
Button text
|
|
409
|
+
</ButtonDropdown>
|
|
410
|
+
<ButtonDropdown disabled theme={EButtonTheme.SECONDARY_LIGHT} size={EComponentSize.MD} options={OPTIONS}>
|
|
411
|
+
Button text
|
|
412
|
+
</ButtonDropdown>
|
|
413
|
+
<ButtonDropdown disabled theme={EButtonTheme.DANGER} size={EComponentSize.MD} options={OPTIONS}>
|
|
414
|
+
Button text
|
|
415
|
+
</ButtonDropdown>
|
|
416
|
+
<ButtonDropdown disabled theme={EButtonDotsTheme.DOTS_SECONDARY} size={EComponentSize.MD} options={OPTIONS}>
|
|
417
|
+
Button text
|
|
418
|
+
</ButtonDropdown>
|
|
419
|
+
<ButtonDropdown
|
|
420
|
+
disabled
|
|
421
|
+
theme={EButtonDotsTheme.DOTS_SECONDARY_LIGHT}
|
|
422
|
+
size={EComponentSize.MD}
|
|
423
|
+
options={OPTIONS}
|
|
424
|
+
>
|
|
425
|
+
Button text
|
|
426
|
+
</ButtonDropdown>
|
|
427
|
+
</div>
|
|
428
|
+
);
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### WithSelectedOption
|
|
432
|
+
|
|
433
|
+
`stories/Buttons/examples/ButtonDropdown/WithSelectedOptionExample.tsx`
|
|
434
|
+
|
|
435
|
+
```tsx
|
|
436
|
+
import React, { useMemo, useState } from "react";
|
|
437
|
+
import { ButtonDropdown, EButtonTheme, EComponentSize, IButtonDropdownOption } from "@sberbusiness/triplex-next";
|
|
438
|
+
|
|
439
|
+
const createOptions = (onItemSelect?: (id: string) => void): IButtonDropdownOption[] => [
|
|
440
|
+
{ id: "opt-1", label: "Действие 1", onSelect: () => onItemSelect?.("opt-1") },
|
|
441
|
+
{ id: "opt-2", label: "Действие 2", onSelect: () => onItemSelect?.("opt-2") },
|
|
442
|
+
{ id: "opt-3", label: "Действие 3", onSelect: () => onItemSelect?.("opt-3") },
|
|
443
|
+
];
|
|
444
|
+
|
|
445
|
+
export const WithSelectedOptionExample = () => {
|
|
446
|
+
const [selectedId, setSelectedId] = useState<string | undefined>("opt-2");
|
|
447
|
+
const options = useMemo(() => createOptions(setSelectedId), []);
|
|
448
|
+
const selected = options.find((o) => o.id === selectedId);
|
|
449
|
+
|
|
450
|
+
return (
|
|
451
|
+
<div style={{ maxWidth: 280 }}>
|
|
452
|
+
<ButtonDropdown theme={EButtonTheme.GENERAL} size={EComponentSize.MD} options={options} selected={selected}>
|
|
453
|
+
Button text
|
|
454
|
+
</ButtonDropdown>
|
|
455
|
+
</div>
|
|
456
|
+
);
|
|
457
|
+
};
|
|
458
|
+
```
|
|
459
|
+
|
|
@@ -120,3 +120,72 @@ src/components/Button/
|
|
|
120
120
|
| Дата | Изменение |
|
|
121
121
|
|---|---|
|
|
122
122
|
| 2026-04-15 | Создан документ AI-ready для `ButtonIcon`. |
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Примеры использования
|
|
127
|
+
|
|
128
|
+
### Default
|
|
129
|
+
|
|
130
|
+
`stories/Buttons/examples/ButtonIcon/DefaultExample.tsx`
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
import React from "react";
|
|
134
|
+
import { DefaulticonStrokePrdIcon32 } from "@sberbusiness/icons-next";
|
|
135
|
+
import { ButtonIcon, EButtonIconShape } from "@sberbusiness/triplex-next";
|
|
136
|
+
|
|
137
|
+
export const DefaultExample = () => (
|
|
138
|
+
<ButtonIcon shape={EButtonIconShape.SQUIRCLE}>
|
|
139
|
+
<DefaulticonStrokePrdIcon32 paletteIndex={5} />
|
|
140
|
+
</ButtonIcon>
|
|
141
|
+
);
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Sizes
|
|
145
|
+
|
|
146
|
+
`stories/Buttons/examples/ButtonIcon/SizesExample.tsx`
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
import React from "react";
|
|
150
|
+
import {
|
|
151
|
+
DefaulticonStrokePrdIcon16,
|
|
152
|
+
DefaulticonStrokePrdIcon20,
|
|
153
|
+
DefaulticonStrokePrdIcon24,
|
|
154
|
+
DefaulticonStrokePrdIcon32,
|
|
155
|
+
} from "@sberbusiness/icons-next";
|
|
156
|
+
import { ButtonIcon, EButtonIconShape } from "@sberbusiness/triplex-next";
|
|
157
|
+
|
|
158
|
+
export const SizesExample = () => (
|
|
159
|
+
<div style={{ display: "flex", alignItems: "center", gap: 16 }}>
|
|
160
|
+
<ButtonIcon shape={EButtonIconShape.SQUIRCLE}>
|
|
161
|
+
<DefaulticonStrokePrdIcon16 paletteIndex={5} />
|
|
162
|
+
</ButtonIcon>
|
|
163
|
+
<ButtonIcon shape={EButtonIconShape.SQUIRCLE}>
|
|
164
|
+
<DefaulticonStrokePrdIcon20 paletteIndex={5} />
|
|
165
|
+
</ButtonIcon>
|
|
166
|
+
<ButtonIcon shape={EButtonIconShape.SQUIRCLE}>
|
|
167
|
+
<DefaulticonStrokePrdIcon24 paletteIndex={5} />
|
|
168
|
+
</ButtonIcon>
|
|
169
|
+
<ButtonIcon shape={EButtonIconShape.SQUIRCLE}>
|
|
170
|
+
<DefaulticonStrokePrdIcon32 paletteIndex={5} />
|
|
171
|
+
</ButtonIcon>
|
|
172
|
+
</div>
|
|
173
|
+
);
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Disabled
|
|
177
|
+
|
|
178
|
+
`stories/Buttons/examples/ButtonIcon/DisabledExample.tsx`
|
|
179
|
+
|
|
180
|
+
```tsx
|
|
181
|
+
import React from "react";
|
|
182
|
+
import { DefaulticonStrokePrdIcon32 } from "@sberbusiness/icons-next";
|
|
183
|
+
import { ButtonIcon, EButtonIconShape } from "@sberbusiness/triplex-next";
|
|
184
|
+
|
|
185
|
+
export const DisabledExample = () => (
|
|
186
|
+
<ButtonIcon shape={EButtonIconShape.SQUIRCLE} disabled>
|
|
187
|
+
<DefaulticonStrokePrdIcon32 paletteIndex={5} />
|
|
188
|
+
</ButtonIcon>
|
|
189
|
+
);
|
|
190
|
+
```
|
|
191
|
+
|
|
@@ -443,3 +443,61 @@ weekday на английском.
|
|
|
443
443
|
| Дата | Изменение |
|
|
444
444
|
|---|---|
|
|
445
445
|
| 2026-04-18 | Создан документ |
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
## Примеры использования
|
|
450
|
+
|
|
451
|
+
### Default
|
|
452
|
+
|
|
453
|
+
`stories/Calendar/examples/DefaultExample.tsx`
|
|
454
|
+
|
|
455
|
+
```tsx
|
|
456
|
+
import moment from "moment";
|
|
457
|
+
import React, { useState } from "react";
|
|
458
|
+
import { Calendar } from "@sberbusiness/triplex-next";
|
|
459
|
+
|
|
460
|
+
export const DefaultExample = () => {
|
|
461
|
+
const [pickedDate, setPickedDate] = useState(moment());
|
|
462
|
+
|
|
463
|
+
return <Calendar pickedDate={pickedDate} onDateChange={setPickedDate} />;
|
|
464
|
+
};
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### PickTypes
|
|
468
|
+
|
|
469
|
+
`stories/Calendar/examples/PickTypesExample.tsx`
|
|
470
|
+
|
|
471
|
+
```tsx
|
|
472
|
+
import moment from "moment";
|
|
473
|
+
import React, { useState } from "react";
|
|
474
|
+
import { Calendar, ECalendarPickType } from "@sberbusiness/triplex-next";
|
|
475
|
+
|
|
476
|
+
export const PickTypesExample = () => {
|
|
477
|
+
const initialDate = moment("2024-01-15");
|
|
478
|
+
const [pickedDateDatePick, setPickedDateDatePick] = useState(initialDate);
|
|
479
|
+
const [pickedDateMonthYearPick, setPickedDateMonthYearPick] = useState(initialDate);
|
|
480
|
+
|
|
481
|
+
return (
|
|
482
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
|
|
483
|
+
<div>
|
|
484
|
+
<div style={{ marginBottom: "8px", fontSize: "16px", fontWeight: "700" }}>DATEPICK</div>
|
|
485
|
+
<Calendar
|
|
486
|
+
pickType={ECalendarPickType.datePick}
|
|
487
|
+
pickedDate={pickedDateDatePick}
|
|
488
|
+
onDateChange={setPickedDateDatePick}
|
|
489
|
+
/>
|
|
490
|
+
</div>
|
|
491
|
+
<div>
|
|
492
|
+
<div style={{ marginBottom: "8px", fontSize: "16px", fontWeight: "700" }}>MONTHYEARPICK</div>
|
|
493
|
+
<Calendar
|
|
494
|
+
pickType={ECalendarPickType.monthYearPick}
|
|
495
|
+
pickedDate={pickedDateMonthYearPick}
|
|
496
|
+
onDateChange={setPickedDateMonthYearPick}
|
|
497
|
+
/>
|
|
498
|
+
</div>
|
|
499
|
+
</div>
|
|
500
|
+
);
|
|
501
|
+
};
|
|
502
|
+
```
|
|
503
|
+
|
|
@@ -124,3 +124,115 @@ version: "1.0"
|
|
|
124
124
|
|---|---|
|
|
125
125
|
| 2026-04-16 | Приведение `Checkbox` к AI-ready: соблюдены правила `docs/ai/codestyle.md`, добавлена AI-документация и unit-тест на передачу `className` корневому `label`. |
|
|
126
126
|
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Примеры использования
|
|
130
|
+
|
|
131
|
+
### Default
|
|
132
|
+
|
|
133
|
+
`stories/Checkbox/examples/DefaultExample.tsx`
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
import React from "react";
|
|
137
|
+
import { Checkbox } from "@sberbusiness/triplex-next";
|
|
138
|
+
|
|
139
|
+
export const DefaultExample = () => <Checkbox>Checkbox label</Checkbox>;
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Sizes
|
|
143
|
+
|
|
144
|
+
`stories/Checkbox/examples/SizesExample.tsx`
|
|
145
|
+
|
|
146
|
+
```tsx
|
|
147
|
+
import React from "react";
|
|
148
|
+
import { Checkbox, EComponentSize, Gap } from "@sberbusiness/triplex-next";
|
|
149
|
+
|
|
150
|
+
export const SizesExample = () => (
|
|
151
|
+
<>
|
|
152
|
+
<Checkbox size={EComponentSize.SM}>SM</Checkbox>
|
|
153
|
+
<Gap size={16} />
|
|
154
|
+
<Checkbox size={EComponentSize.MD}>MD</Checkbox>
|
|
155
|
+
<Gap size={16} />
|
|
156
|
+
<Checkbox size={EComponentSize.LG}>LG</Checkbox>
|
|
157
|
+
</>
|
|
158
|
+
);
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### XGroup
|
|
162
|
+
|
|
163
|
+
`stories/Checkbox/examples/XGroupExample.tsx`
|
|
164
|
+
|
|
165
|
+
```tsx
|
|
166
|
+
import React from "react";
|
|
167
|
+
import { Checkbox, CheckboxXGroup, EComponentSize, Gap } from "@sberbusiness/triplex-next";
|
|
168
|
+
|
|
169
|
+
export const XGroupExample = () => (
|
|
170
|
+
<>
|
|
171
|
+
<CheckboxXGroup indent={16}>
|
|
172
|
+
{[1, 2, 3].map((value) => (
|
|
173
|
+
<Checkbox key={value} name="checkbox-x-group" value={value} size={EComponentSize.SM}>
|
|
174
|
+
Checkbox text
|
|
175
|
+
</Checkbox>
|
|
176
|
+
))}
|
|
177
|
+
</CheckboxXGroup>
|
|
178
|
+
<Gap size={16} />
|
|
179
|
+
<CheckboxXGroup indent={16}>
|
|
180
|
+
{[1, 2, 3].map((value) => (
|
|
181
|
+
<Checkbox key={value} name="checkbox-x-group" value={value}>
|
|
182
|
+
Checkbox text
|
|
183
|
+
</Checkbox>
|
|
184
|
+
))}
|
|
185
|
+
</CheckboxXGroup>
|
|
186
|
+
<Gap size={16} />
|
|
187
|
+
<CheckboxXGroup indent={20}>
|
|
188
|
+
{[1, 2, 3].map((value) => (
|
|
189
|
+
<Checkbox key={value} name="checkbox-x-group" value={value} size={EComponentSize.LG}>
|
|
190
|
+
Checkbox text
|
|
191
|
+
</Checkbox>
|
|
192
|
+
))}
|
|
193
|
+
</CheckboxXGroup>
|
|
194
|
+
</>
|
|
195
|
+
);
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### YGroup
|
|
199
|
+
|
|
200
|
+
`stories/Checkbox/examples/YGroupExample.tsx`
|
|
201
|
+
|
|
202
|
+
```tsx
|
|
203
|
+
import React from "react";
|
|
204
|
+
import { Checkbox, CheckboxYGroup, Col, EComponentSize, Row } from "@sberbusiness/triplex-next";
|
|
205
|
+
|
|
206
|
+
export const YGroupExample = () => (
|
|
207
|
+
<Row>
|
|
208
|
+
<Col size={3}>
|
|
209
|
+
<CheckboxYGroup aria-labelledby="checkbox-y-group-label">
|
|
210
|
+
{[1, 2, 3, 4].map((value) => (
|
|
211
|
+
<Checkbox key={value} name="checkbox-y-group" value={value} size={EComponentSize.SM}>
|
|
212
|
+
Checkbox text
|
|
213
|
+
</Checkbox>
|
|
214
|
+
))}
|
|
215
|
+
</CheckboxYGroup>
|
|
216
|
+
</Col>
|
|
217
|
+
<Col size={3}>
|
|
218
|
+
<CheckboxYGroup aria-labelledby="checkbox-y-group-label">
|
|
219
|
+
{[1, 2, 3, 4].map((value) => (
|
|
220
|
+
<Checkbox key={value} name="checkbox-y-group" value={value}>
|
|
221
|
+
Checkbox text
|
|
222
|
+
</Checkbox>
|
|
223
|
+
))}
|
|
224
|
+
</CheckboxYGroup>
|
|
225
|
+
</Col>
|
|
226
|
+
<Col size={3}>
|
|
227
|
+
<CheckboxYGroup aria-labelledby="checkbox-y-group-label">
|
|
228
|
+
{[1, 2, 3, 4].map((value) => (
|
|
229
|
+
<Checkbox key={value} name="checkbox-y-group" value={value} size={EComponentSize.LG}>
|
|
230
|
+
Checkbox text
|
|
231
|
+
</Checkbox>
|
|
232
|
+
))}
|
|
233
|
+
</CheckboxYGroup>
|
|
234
|
+
</Col>
|
|
235
|
+
</Row>
|
|
236
|
+
);
|
|
237
|
+
```
|
|
238
|
+
|
|
@@ -278,3 +278,64 @@ onChange/bulk/checked. **Не упрощать** — CheckboxTreeExtended пол
|
|
|
278
278
|
| Дата | Изменение |
|
|
279
279
|
|---|---|
|
|
280
280
|
| 2026-04-18 | Создан документ |
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Примеры использования
|
|
285
|
+
|
|
286
|
+
### Default
|
|
287
|
+
|
|
288
|
+
`stories/CheckboxTree/examples/DefaultExample.tsx`
|
|
289
|
+
|
|
290
|
+
```tsx
|
|
291
|
+
import React, { useState } from "react";
|
|
292
|
+
import { CheckboxTree, ICheckboxTreeCheckboxData } from "@sberbusiness/triplex-next";
|
|
293
|
+
|
|
294
|
+
const SAMPLE: ICheckboxTreeCheckboxData[] = [
|
|
295
|
+
{ id: "1", label: "Группа 1", checked: false, children: [{ id: "1-1", label: "Значение 1-1", checked: false }] },
|
|
296
|
+
{ id: "2", label: "Группа 2", checked: false },
|
|
297
|
+
];
|
|
298
|
+
|
|
299
|
+
export const DefaultExample = () => {
|
|
300
|
+
const [checkboxes, setCheckboxes] = useState<ICheckboxTreeCheckboxData[]>(SAMPLE);
|
|
301
|
+
return <CheckboxTree checkboxes={checkboxes} onChange={setCheckboxes} />;
|
|
302
|
+
};
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Sizes
|
|
306
|
+
|
|
307
|
+
`stories/CheckboxTree/examples/SizesExample.tsx`
|
|
308
|
+
|
|
309
|
+
```tsx
|
|
310
|
+
import React, { useState } from "react";
|
|
311
|
+
import { CheckboxTree, Col, EComponentSize, ICheckboxTreeCheckboxData, Row } from "@sberbusiness/triplex-next";
|
|
312
|
+
|
|
313
|
+
const createData = (): ICheckboxTreeCheckboxData[] => [
|
|
314
|
+
{ id: "1", label: "Группа 1", checked: false, children: [{ id: "1-1", label: "Значение 1-1", checked: false }] },
|
|
315
|
+
{ id: "2", label: "Группа 2", checked: false },
|
|
316
|
+
];
|
|
317
|
+
|
|
318
|
+
export const SizesExample = () => {
|
|
319
|
+
const [sm, setSm] = useState<ICheckboxTreeCheckboxData[]>(createData());
|
|
320
|
+
const [md, setMd] = useState<ICheckboxTreeCheckboxData[]>(createData());
|
|
321
|
+
const [lg, setLg] = useState<ICheckboxTreeCheckboxData[]>(createData());
|
|
322
|
+
|
|
323
|
+
return (
|
|
324
|
+
<Row>
|
|
325
|
+
<Col size={4}>
|
|
326
|
+
<div style={{ marginBottom: "8px", fontSize: "16px", fontWeight: "700" }}>SM</div>
|
|
327
|
+
<CheckboxTree checkboxes={sm} onChange={setSm} size={EComponentSize.SM} />
|
|
328
|
+
</Col>
|
|
329
|
+
<Col size={4}>
|
|
330
|
+
<div style={{ marginBottom: "8px", fontSize: "16px", fontWeight: "700" }}>MD</div>
|
|
331
|
+
<CheckboxTree checkboxes={md} onChange={setMd} />
|
|
332
|
+
</Col>
|
|
333
|
+
<Col size={4}>
|
|
334
|
+
<div style={{ marginBottom: "8px", fontSize: "16px", fontWeight: "700" }}>LG</div>
|
|
335
|
+
<CheckboxTree checkboxes={lg} onChange={setLg} size={EComponentSize.LG} />
|
|
336
|
+
</Col>
|
|
337
|
+
</Row>
|
|
338
|
+
);
|
|
339
|
+
};
|
|
340
|
+
```
|
|
341
|
+
|