fsk-design-system 1.13.1 → 1.13.2
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/README.md +64 -101
- package/dist/_virtual/index3.js +4 -1
- package/dist/components/ActionMenu/ActionMenu.types.d.ts +5 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +3 -3
- package/dist/components/Button/Button.types.d.ts +2 -0
- package/dist/components/Card/Card.types.d.ts +8 -0
- package/dist/components/Card/LinkCard/LinkCard.types.d.ts +8 -0
- package/dist/components/Cascader/Cascader.types.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +5 -0
- package/dist/components/Comment/Comment.types.d.ts +9 -0
- package/dist/components/Comment/Form/Form.types.d.ts +4 -0
- package/dist/components/ControlWrapper/ControlWrapper.types.d.ts +8 -0
- package/dist/components/DatePicker/DatePicker.styles.js +4 -4
- package/dist/components/DatePicker/DatePicker.types.d.ts +2 -0
- package/dist/components/Drawer/Drawer.types.d.ts +1 -0
- package/dist/components/Image/Image.types.d.ts +1 -0
- package/dist/components/Input/Input.OTP/Input.OTP.types.d.ts +2 -0
- package/dist/components/Input/Input.Password/Input.Password.types.d.ts +1 -0
- package/dist/components/Input/Input.types.d.ts +1 -0
- package/dist/components/InputNumber/InputNumber.types.d.ts +1 -0
- package/dist/components/Layout/Footer/Footer.types.d.ts +1 -0
- package/dist/components/Layout/Layout.types.d.ts +5 -0
- package/dist/components/Layout/Sider/Sider.types.d.ts +3 -0
- package/dist/components/Menu/Menu.js +43 -33
- package/dist/components/Menu/Menu.styles.js +68 -29
- package/dist/components/Menu/Menu.types.d.ts +5 -0
- package/dist/components/Menu/components/LeafGroupPanel.d.ts +8 -0
- package/dist/components/Menu/components/LeafGroupPanel.js +29 -0
- package/dist/components/Menu/components/LevelSearch.d.ts +7 -0
- package/dist/components/Menu/components/LevelSearch.js +19 -0
- package/dist/components/Menu/components/VirtualCheckboxList.d.ts +7 -0
- package/dist/components/Menu/components/VirtualCheckboxList.js +28 -0
- package/dist/components/Menu/components/menuControls.d.ts +22 -0
- package/dist/components/Menu/components/menuControls.js +44 -0
- package/dist/components/Menu/hooks/useGroupSelectionState.d.ts +5 -0
- package/dist/components/Menu/hooks/useGroupSelectionState.js +19 -0
- package/dist/components/Menu/hooks/useMenuOptions.d.ts +9 -0
- package/dist/components/Menu/hooks/useMenuOptions.js +79 -0
- package/dist/components/Menu/hooks/useSelected.d.ts +1 -0
- package/dist/components/Menu/hooks/useSelected.js +9 -0
- package/dist/components/Menu/options/optionTree.d.ts +17 -0
- package/dist/components/Menu/options/optionTree.js +38 -0
- package/dist/components/Menu/options/optionTree.test.d.ts +1 -0
- package/dist/components/Menu/store/SelectionContext.d.ts +4 -0
- package/dist/components/Menu/store/SelectionContext.js +11 -0
- package/dist/components/Menu/store/createSelectionStore.d.ts +14 -0
- package/dist/components/Menu/store/createSelectionStore.js +62 -0
- package/dist/components/Menu/store/createSelectionStore.test.d.ts +1 -0
- package/dist/components/Message/Message.styles.js +3 -3
- package/dist/components/Message/Message.types.d.ts +8 -0
- package/dist/components/Modal/Modal.types.d.ts +2 -0
- package/dist/components/Notification/Notification.types.d.ts +7 -0
- package/dist/components/PhoneInput/CountrySelect/CountrySelect.types.d.ts +6 -0
- package/dist/components/PhoneInput/PhoneInput.types.d.ts +1 -0
- package/dist/components/Plug/Plug.types.d.ts +2 -0
- package/dist/components/Radio/Radio.types.d.ts +5 -0
- package/dist/components/Select/Select.types.d.ts +1 -0
- package/dist/components/Spin/Spin.types.d.ts +3 -0
- package/dist/components/Switch/Switch.types.d.ts +5 -0
- package/dist/components/Table/Table.types.d.ts +1 -0
- package/dist/components/Tabs/Tabs.js +62 -62
- package/dist/components/Tabs/Tabs.types.d.ts +5 -1
- package/dist/components/Tag/Tag.types.d.ts +3 -0
- package/dist/components/TextArea/TextArea.js +19 -19
- package/dist/components/TextArea/TextArea.styles.js +27 -27
- package/dist/components/Tour/Tour.types.d.ts +7 -0
- package/dist/components/Upload/Dragger/Dragger.types.d.ts +1 -0
- package/dist/components/Upload/FileButton/FileButton.types.d.ts +4 -0
- package/dist/components/Upload/Upload.types.d.ts +1 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +7 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +6 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/createClass.js +15 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/createSuper.js +17 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/inherits.js +16 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +10 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +8 -0
- package/dist/node_modules/rc-resize-observer/es/Collection.js +22 -0
- package/dist/node_modules/rc-resize-observer/es/SingleObserver/DomWrapper.js +21 -0
- package/dist/node_modules/rc-resize-observer/es/SingleObserver/index.js +59 -0
- package/dist/node_modules/rc-resize-observer/es/index.js +24 -0
- package/dist/node_modules/rc-resize-observer/es/utils/observerUtil.js +23 -0
- package/dist/node_modules/rc-util/es/Children/toArray.js +11 -0
- package/dist/node_modules/rc-util/es/Dom/findDOMNode.js +24 -0
- package/dist/node_modules/rc-util/es/React/isFragment.js +13 -0
- package/dist/node_modules/rc-util/es/hooks/useEvent.js +14 -0
- package/dist/node_modules/rc-util/es/hooks/useLayoutEffect.js +14 -2
- package/dist/node_modules/rc-util/es/hooks/useMemo.js +8 -0
- package/dist/node_modules/rc-util/es/raf.js +40 -0
- package/dist/node_modules/rc-util/es/ref.js +52 -3
- package/dist/node_modules/rc-virtual-list/es/Filler.js +34 -0
- package/dist/node_modules/rc-virtual-list/es/Item.js +12 -0
- package/dist/node_modules/rc-virtual-list/es/List.js +286 -0
- package/dist/node_modules/rc-virtual-list/es/ScrollBar.js +130 -0
- package/dist/node_modules/rc-virtual-list/es/hooks/useChildren.js +22 -0
- package/dist/node_modules/rc-virtual-list/es/hooks/useDiffItem.js +13 -0
- package/dist/node_modules/rc-virtual-list/es/hooks/useFrameWheel.js +42 -0
- package/dist/node_modules/rc-virtual-list/es/hooks/useGetSize.js +25 -0
- package/dist/node_modules/rc-virtual-list/es/hooks/useHeights.js +48 -0
- package/dist/node_modules/rc-virtual-list/es/hooks/useMobileTouchMove.js +38 -0
- package/dist/node_modules/rc-virtual-list/es/hooks/useOriginScroll.js +27 -0
- package/dist/node_modules/rc-virtual-list/es/hooks/useScrollDrag.js +49 -0
- package/dist/node_modules/rc-virtual-list/es/hooks/useScrollTo.js +82 -0
- package/dist/node_modules/rc-virtual-list/es/index.js +4 -0
- package/dist/node_modules/rc-virtual-list/es/utils/CacheMap.js +36 -0
- package/dist/node_modules/rc-virtual-list/es/utils/algorithmUtil.js +26 -0
- package/dist/node_modules/rc-virtual-list/es/utils/isFirefox.js +5 -0
- package/dist/node_modules/rc-virtual-list/es/utils/scrollbarUtil.js +8 -0
- package/dist/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +290 -0
- package/package.json +1 -1
- package/dist/components/Menu/hooks/useBuildMenuItems.d.ts +0 -13
- package/dist/components/Menu/hooks/useBuildMenuItems.js +0 -84
- package/dist/components/Menu/hooks/useIndeterminateKeys.d.ts +0 -4
- package/dist/components/Menu/hooks/useIndeterminateKeys.js +0 -17
- package/dist/components/Menu/utils/getAllKeys.d.ts +0 -2
- package/dist/components/Menu/utils/getAllKeys.js +0 -9
package/README.md
CHANGED
|
@@ -2,160 +2,123 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/fsk-design-system)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Дизайн-система ФСК: библиотека React-компонентов на базе **Ant Design 5** и **Emotion** — фирменные стили и типографика, светлая и тёмная темы, русская локаль, полная типизация.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
📚 [Storybook — живая документация](https://design-system.k8s-test.fsk.ru) · 📝 [Changelog](./CHANGELOG.md) · 🤝 [Contributing](./CONTRIBUTING.md)
|
|
8
8
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
### 1. Основной пакет
|
|
9
|
+
## Установка
|
|
12
10
|
|
|
13
11
|
```bash
|
|
14
12
|
npm install fsk-design-system
|
|
15
13
|
```
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
> 💡 Если в вашем проекте они уже установлены — этот шаг можно пропустить.
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"antd": ">=5.27.4 <6.0.0",
|
|
24
|
-
"react": ">=18.3.1 <19.0.0",
|
|
25
|
-
"react-dom": ">=18.3.1 <19.0.0"
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
#### npm
|
|
15
|
+
Peer-зависимости (если их ещё нет в проекте):
|
|
30
16
|
|
|
31
17
|
```bash
|
|
32
|
-
npm install antd
|
|
18
|
+
npm install antd@^5.27.4 react@^18.3.1 react-dom@^18.3.1
|
|
33
19
|
```
|
|
34
20
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
yarn add antd@5.27.4 react@18.3.1 react-dom@18.3.1
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
#### pnpm
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
pnpm add antd@5.27.4 react@18.3.1 react-dom@18.3.1
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## ⚡ Быстрый старт
|
|
48
|
-
|
|
49
|
-
#### 1️⃣ Импортируйте стили
|
|
50
|
-
|
|
51
|
-
```ts
|
|
52
|
-
import 'fsk-design-system/styles.css';
|
|
53
|
-
```
|
|
21
|
+
## Быстрый старт
|
|
54
22
|
|
|
55
|
-
|
|
23
|
+
Подключите стили и оберните приложение в `ThemeProvider`. Для тостов и уведомлений добавьте `MessageProvider` и `NotificationProvider`:
|
|
56
24
|
|
|
57
25
|
```tsx
|
|
58
|
-
import
|
|
26
|
+
import "fsk-design-system/styles.css"
|
|
59
27
|
|
|
60
|
-
import { ThemeProvider } from
|
|
28
|
+
import { MessageProvider, NotificationProvider, ThemeProvider } from "fsk-design-system"
|
|
61
29
|
|
|
62
|
-
const App = () => (
|
|
30
|
+
export const App = () => (
|
|
63
31
|
<ThemeProvider>
|
|
64
|
-
|
|
32
|
+
<NotificationProvider>
|
|
33
|
+
<MessageProvider>{/* ваше приложение */}</MessageProvider>
|
|
34
|
+
</NotificationProvider>
|
|
65
35
|
</ThemeProvider>
|
|
66
|
-
)
|
|
36
|
+
)
|
|
67
37
|
```
|
|
68
38
|
|
|
69
|
-
|
|
39
|
+
Дальше — просто импортируйте компоненты:
|
|
70
40
|
|
|
71
41
|
```tsx
|
|
72
|
-
import {
|
|
42
|
+
import { Button, Input, useNotification } from "fsk-design-system"
|
|
73
43
|
|
|
74
|
-
const
|
|
75
|
-
<ThemeProvider>
|
|
76
|
-
<NotificationProvider>
|
|
77
|
-
<Component />
|
|
78
|
-
</NotificationProvider>
|
|
79
|
-
</ThemeProvider>
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
const Component = () => {
|
|
44
|
+
const Form = () => {
|
|
83
45
|
const notify = useNotification()
|
|
84
46
|
|
|
85
47
|
return (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
48
|
+
<>
|
|
49
|
+
<Input label="Email" placeholder="example@mail.com" />
|
|
50
|
+
<Button size="l" type="main-primary" onClick={() => notify.success({ message: "Сохранено" })}>
|
|
51
|
+
Сохранить
|
|
52
|
+
</Button>
|
|
53
|
+
</>
|
|
89
54
|
)
|
|
90
|
-
}
|
|
55
|
+
}
|
|
91
56
|
```
|
|
92
57
|
|
|
93
|
-
##
|
|
58
|
+
## Точки входа пакета
|
|
94
59
|
|
|
95
|
-
|
|
60
|
+
| Импорт | Содержимое |
|
|
61
|
+
| ------------------------------- | ------------------------------------------------- |
|
|
62
|
+
| `fsk-design-system` | Компоненты, провайдеры, хуки, темы |
|
|
63
|
+
| `fsk-design-system/components` | Только компоненты (без импорта глобальных стилей) |
|
|
64
|
+
| `fsk-design-system/icons` | Иконки (Solar + кастомные) |
|
|
65
|
+
| `fsk-design-system/styles.css` | Глобальные стили, CSS-токены и шрифт Golos Text |
|
|
96
66
|
|
|
97
|
-
|
|
98
|
-
import { Button, Input } from 'fsk-design-system';
|
|
67
|
+
Сборка ESM с сохранением модулей — импортируется только то, что используете.
|
|
99
68
|
|
|
100
|
-
|
|
101
|
-
<Input label="Email" placeholder="example@mail.com" />
|
|
102
|
-
```
|
|
69
|
+
## Темы
|
|
103
70
|
|
|
104
|
-
|
|
71
|
+
Доступны `light` (по умолчанию) и `dark`. Переключение — через хук `useTheme`:
|
|
105
72
|
|
|
106
73
|
```tsx
|
|
107
|
-
import { useTheme } from
|
|
74
|
+
import { useTheme } from "fsk-design-system"
|
|
108
75
|
|
|
109
76
|
const ThemeSwitcher = () => {
|
|
110
|
-
const { changeTheme } = useTheme()
|
|
77
|
+
const { theme, changeTheme } = useTheme()
|
|
111
78
|
|
|
112
|
-
return (
|
|
113
|
-
|
|
114
|
-
Переключить на тёмную тему
|
|
115
|
-
</button>
|
|
116
|
-
);
|
|
117
|
-
};
|
|
79
|
+
return <button onClick={() => changeTheme(theme === "dark" ? "light" : "dark")}>Сменить тему</button>
|
|
80
|
+
}
|
|
118
81
|
```
|
|
119
82
|
|
|
120
|
-
|
|
83
|
+
Вместе со стилями подключаются CSS-токены — цвета, отступы, типографика, тени и скругления. Используйте их в своих стилях, чтобы автоматически поддерживать обе темы:
|
|
121
84
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
85
|
+
```css
|
|
86
|
+
.card {
|
|
87
|
+
padding: var(--gap-xs);
|
|
88
|
+
font: var(--font-body-medium-m);
|
|
89
|
+
color: var(--color-text-primary);
|
|
90
|
+
background: var(--color-surface-primary);
|
|
91
|
+
border-radius: var(--radius-xs);
|
|
92
|
+
}
|
|
93
|
+
```
|
|
126
94
|
|
|
127
|
-
|
|
95
|
+
Полный справочник токенов — в разделе [«Дизайн-токены»](https://design-system.k8s-test.fsk.ru) Storybook.
|
|
128
96
|
|
|
129
|
-
Иконки
|
|
97
|
+
## Иконки
|
|
130
98
|
|
|
131
|
-
|
|
99
|
+
Набор повторяет [Solar Icons](https://solar-icons.vercel.app/icons) (~1400 иконок, 6 начертаний) и дополнен кастомными. Галерея с поиском и копированием импорта — в разделе [«Иконки»](https://design-system.k8s-test.fsk.ru) Storybook.
|
|
132
100
|
|
|
133
101
|
```tsx
|
|
134
|
-
import { InfoCircle } from
|
|
102
|
+
import { InfoCircle } from "fsk-design-system/icons"
|
|
135
103
|
|
|
136
|
-
|
|
104
|
+
const icon = <InfoCircle size={20} weight="Outline" />
|
|
137
105
|
```
|
|
138
106
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
Пример:
|
|
107
|
+
Для стрелок и других направленных иконок используйте одну иконку с поворотом — так набор остаётся визуально согласованным:
|
|
142
108
|
|
|
143
109
|
```tsx
|
|
144
|
-
|
|
145
|
-
import { ArrowDown, ArrowLeft, ArrowRight, ArrowUp } from 'fsk-design-system/icons';
|
|
110
|
+
import { ArrowDown } from "fsk-design-system/icons"
|
|
146
111
|
|
|
147
|
-
<ArrowDown />
|
|
148
|
-
|
|
149
|
-
<ArrowUp />
|
|
150
|
-
<ArrowRight />
|
|
112
|
+
const arrowLeft = <ArrowDown style={{ transform: "rotate(90deg)" }} />
|
|
113
|
+
```
|
|
151
114
|
|
|
152
|
-
|
|
153
|
-
import { ArrowDown } from 'fsk-design-system/icons';
|
|
115
|
+
## Разработка
|
|
154
116
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
117
|
+
```bash
|
|
118
|
+
npm run dev # Storybook на localhost:6006
|
|
119
|
+
npm run test # vitest в watch-режиме
|
|
120
|
+
npm run lint # eslint + tsc
|
|
121
|
+
npm run build # сборка библиотеки
|
|
159
122
|
```
|
|
160
123
|
|
|
161
|
-
|
|
124
|
+
Коммиты — по [Conventional Commits](https://www.conventionalcommits.org/ru/): от них зависят версионирование и генерация ченжлога. Правила оформления кода и документации — в [CONTRIBUTING.md](./CONTRIBUTING.md).
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { BadgeProps } from '../Badge';
|
|
2
2
|
import { ButtonProps } from '../Button';
|
|
3
3
|
export type ActionMenuProps = {
|
|
4
|
+
/** Заголовок меню действий */
|
|
4
5
|
title: string;
|
|
6
|
+
/** Значение счётчика, отображаемого рядом с заголовком */
|
|
5
7
|
count?: BadgeProps["count"];
|
|
8
|
+
/** Список кнопок действий, отображаемых в меню */
|
|
6
9
|
actions: Action[];
|
|
10
|
+
/** Признак видимости меню */
|
|
7
11
|
visible: boolean;
|
|
12
|
+
/** Вызывается после завершения анимации закрытия меню */
|
|
8
13
|
onClose?: () => void;
|
|
9
14
|
};
|
|
10
15
|
export type Action = ButtonProps;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const a = (t) => /* @__PURE__ */ r(
|
|
2
|
+
import { AltArrowRight as o } from "@solar-icons/react";
|
|
3
|
+
import { StyledBreadcrumb as e } from "./Breadcrumb.styles.js";
|
|
4
|
+
const a = (t) => /* @__PURE__ */ r(e, { separator: /* @__PURE__ */ r(o, { weight: "Outline" }), ...t });
|
|
5
5
|
export {
|
|
6
6
|
a as Breadcrumb
|
|
7
7
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Button, ButtonProps as AntButtonProps } from 'antd';
|
|
2
2
|
export type ButtonProps = Omit<AntButtonProps, "size" | "type" | "shape"> & {
|
|
3
|
+
/** Размер кнопки @default "m" */
|
|
3
4
|
size?: "xs" | "s" | "m" | "l";
|
|
5
|
+
/** Визуальный стиль кнопки @default "main-primary" */
|
|
4
6
|
type?: "main-primary" | "main-outline" | "link-primary" | "link-secondary" | "extra-primary" | "extra-outline" | "primary-gradient";
|
|
5
7
|
};
|
|
6
8
|
export type ButtonRef = React.ComponentRef<typeof Button>;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { TagProps } from '../Tag';
|
|
2
2
|
export type CardProps = {
|
|
3
|
+
/** Изображение или контент обложки карточки */
|
|
3
4
|
cover?: React.ReactNode;
|
|
5
|
+
/** Список тегов, отображаемых над заголовком */
|
|
4
6
|
tags?: TagProps[];
|
|
7
|
+
/** Дата, отображаемая над заголовком */
|
|
5
8
|
date?: string;
|
|
9
|
+
/** Заголовок карточки */
|
|
6
10
|
title?: React.ReactNode;
|
|
11
|
+
/** Основной текст карточки */
|
|
7
12
|
text?: React.ReactNode;
|
|
13
|
+
/** Содержимое подвала карточки */
|
|
8
14
|
footer?: React.ReactNode;
|
|
15
|
+
/** Размер карточки @default "m" */
|
|
9
16
|
size?: "m" | "l";
|
|
17
|
+
/** Дополнительный класс корневого элемента */
|
|
10
18
|
className?: string;
|
|
11
19
|
};
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { TagProps } from '../../Tag';
|
|
2
2
|
export type LinkCardProps = {
|
|
3
|
+
/** Заголовок карточки */
|
|
3
4
|
title?: React.ReactNode;
|
|
5
|
+
/** Значение счётчика, отображается бейджем рядом с заголовком */
|
|
4
6
|
count?: string | number;
|
|
7
|
+
/** Список тегов, отображаемых под заголовком */
|
|
5
8
|
tags?: TagProps[];
|
|
9
|
+
/** Основной текст карточки */
|
|
6
10
|
text?: React.ReactNode;
|
|
11
|
+
/** Дополнительный контент под текстом */
|
|
7
12
|
extraContent?: React.ReactNode;
|
|
13
|
+
/** Ссылка внизу карточки; строка рендерится как ссылка-адрес, иначе выводится как есть */
|
|
8
14
|
link?: React.ReactNode;
|
|
15
|
+
/** Дополнительный класс корневого элемента */
|
|
9
16
|
className?: string;
|
|
17
|
+
/** Обработчик клика по карточке */
|
|
10
18
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
11
19
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CascaderProps as AntCascaderProps, DefaultOptionType } from 'antd/es/cascader';
|
|
2
2
|
import { ControlWrapperProps } from '../ControlWrapper';
|
|
3
3
|
export type CascaderProps<OptionType extends DefaultOptionType = DefaultOptionType, ValueField extends keyof OptionType = keyof OptionType, Multiple extends boolean = boolean> = React.PropsWithChildren<Omit<AntCascaderProps<OptionType, ValueField, Multiple>, "status" | "children" | "size"> & ControlWrapperProps & {
|
|
4
|
+
/** Статус валидации поля */
|
|
4
5
|
status?: "success" | "error";
|
|
5
6
|
}>;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { CheckboxProps as AntCheckboxProps } from 'antd';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
export type CheckboxProps = React.PropsWithChildren<AntCheckboxProps> & {
|
|
4
|
+
/** Размер чекбокса @default "m" */
|
|
4
5
|
size?: "s" | "m";
|
|
6
|
+
/** Дополнительный контент, отображаемый рядом с чекбоксом */
|
|
5
7
|
extraContent?: React.ReactNode;
|
|
8
|
+
/** Подпись под чекбоксом */
|
|
6
9
|
caption?: React.ReactNode;
|
|
10
|
+
/** Статус валидации, влияющий на оформление */
|
|
7
11
|
status?: "success" | "error";
|
|
12
|
+
/** Текст ошибки, показывается вместо подписи */
|
|
8
13
|
error?: string;
|
|
9
14
|
};
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { AvatarProps } from 'antd';
|
|
2
2
|
type Comment = {
|
|
3
|
+
/** Пропсы аватара автора комментария */
|
|
3
4
|
avatar?: AvatarProps;
|
|
5
|
+
/** Имя автора комментария */
|
|
4
6
|
name?: React.ReactNode;
|
|
7
|
+
/** Дата комментария, отображается в относительном формате (например, "3 часа назад") */
|
|
5
8
|
date?: string;
|
|
9
|
+
/** Текст комментария */
|
|
6
10
|
text?: string;
|
|
11
|
+
/** Уровень вложенности комментария (0 — корневой) @default 0 */
|
|
7
12
|
depthLevel?: number;
|
|
13
|
+
/** Разрешает ли комментарий ответы (показывает кнопку "Ответить") @default true */
|
|
8
14
|
canBeReplied?: boolean;
|
|
15
|
+
/** Вызывается при клике на кнопку "Ответить" */
|
|
9
16
|
onReply?: () => void;
|
|
17
|
+
/** Дополнительный контент, отображаемый справа от комментария */
|
|
10
18
|
extraContent?: React.ReactNode;
|
|
11
19
|
};
|
|
12
20
|
export type CommentProps = Comment & {
|
|
21
|
+
/** Список ответов на комментарий @default [] */
|
|
13
22
|
replys?: Comment[];
|
|
14
23
|
};
|
|
15
24
|
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { AvatarProps, FormProps } from 'antd';
|
|
2
2
|
export type CommentFormProps = {
|
|
3
|
+
/** Пропсы аватара автора комментария */
|
|
3
4
|
avatar?: AvatarProps;
|
|
5
|
+
/** Пропсы вложенной формы antd */
|
|
4
6
|
form?: FormProps;
|
|
7
|
+
/** Текст кнопки отправки комментария @default "Отправить" */
|
|
5
8
|
buttonText?: string;
|
|
9
|
+
/** Дополнительный класс корневого элемента формы */
|
|
6
10
|
className?: string;
|
|
7
11
|
};
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { FormItemProps } from 'antd';
|
|
2
2
|
export type ControlWrapperProps = React.PropsWithChildren<{
|
|
3
|
+
/** Отмечает поле как обязательное, добавляя звёздочку рядом с label */
|
|
3
4
|
isRequired?: boolean;
|
|
5
|
+
/** Текст ошибки, отображается вместо caption и подсвечивается красным */
|
|
4
6
|
error?: string;
|
|
7
|
+
/** Подпись (заголовок) над или рядом с контролом */
|
|
5
8
|
label?: React.ReactNode;
|
|
9
|
+
/** Подсказка под контролом, скрывается при наличии error */
|
|
6
10
|
caption?: React.ReactNode;
|
|
11
|
+
/** Расположение label относительно контрола @default "vertical" */
|
|
7
12
|
view?: "vertical" | "horizontal";
|
|
13
|
+
/** Размер обёртки: влияет на шрифты label/caption и отступы @default "m" */
|
|
8
14
|
size?: "s" | "m" | "l";
|
|
15
|
+
/** Статус поля формы, определяет цвет caption (success/error) */
|
|
9
16
|
formControlStatus?: FormItemProps["status"];
|
|
17
|
+
/** CSS-класс обёртки */
|
|
10
18
|
className?: string;
|
|
11
19
|
}>;
|