@vchasno/ui-kit 0.1.0
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/CHANGELOG.md +14 -0
- package/README.md +119 -0
- package/dist/css/_base.css +80 -0
- package/dist/css/_reset.css +209 -0
- package/dist/css/_theme.css +57 -0
- package/dist/index.d.ts +214 -0
- package/dist/index.js +18447 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +14 -0
- package/dist/types/components/Alert/Alert.d.ts +16 -0
- package/dist/types/components/Alert/index.d.ts +2 -0
- package/dist/types/components/Button/Button.d.ts +12 -0
- package/dist/types/components/Button/index.d.ts +2 -0
- package/dist/types/components/Checkbox/Checkbox.d.ts +11 -0
- package/dist/types/components/Checkbox/index.d.ts +2 -0
- package/dist/types/components/Datepicker/DatePicker.d.ts +11 -0
- package/dist/types/components/Datepicker/index.d.ts +2 -0
- package/dist/types/components/FlexBox/FlexBox.d.ts +15 -0
- package/dist/types/components/FlexBox/index.d.ts +2 -0
- package/dist/types/components/Input/Input.d.ts +15 -0
- package/dist/types/components/Input/index.d.ts +2 -0
- package/dist/types/components/InputMeta/InputMeta.d.ts +8 -0
- package/dist/types/components/InputMeta/index.d.ts +2 -0
- package/dist/types/components/LabelText/LabelText.d.ts +8 -0
- package/dist/types/components/LabelText/index.d.ts +1 -0
- package/dist/types/components/MaskInput/MaskInput.d.ts +10 -0
- package/dist/types/components/MaskInput/index.d.ts +2 -0
- package/dist/types/components/Pagination/Pagination.d.ts +13 -0
- package/dist/types/components/Pagination/index.d.ts +2 -0
- package/dist/types/components/Pagination/utils.d.ts +1 -0
- package/dist/types/components/Paragraph/Paragraph.d.ts +9 -0
- package/dist/types/components/Paragraph/index.d.ts +2 -0
- package/dist/types/components/Select/Select.d.ts +10 -0
- package/dist/types/components/Select/SelectCreatable.d.ts +13 -0
- package/dist/types/components/Select/customComponents.d.ts +9 -0
- package/dist/types/components/Select/defaultProps.d.ts +6 -0
- package/dist/types/components/Select/index.d.ts +5 -0
- package/dist/types/components/Select/types.d.ts +4 -0
- package/dist/types/components/Spinner/Spinner.d.ts +18 -0
- package/dist/types/components/Spinner/index.d.ts +2 -0
- package/dist/types/components/Switcher/Switcher.d.ts +11 -0
- package/dist/types/components/Switcher/index.d.ts +2 -0
- package/dist/types/components/Tabs/Tabs.d.ts +19 -0
- package/dist/types/components/Tabs/index.d.ts +2 -0
- package/dist/types/components/Text/Text.d.ts +14 -0
- package/dist/types/components/Text/index.d.ts +2 -0
- package/dist/types/components/TextAreaInput/TextAreaInput.d.ts +10 -0
- package/dist/types/components/TextAreaInput/index.d.ts +2 -0
- package/dist/types/components/TextInput/TextInput.d.ts +9 -0
- package/dist/types/components/TextInput/index.d.ts +2 -0
- package/dist/types/components/Title/Title.d.ts +9 -0
- package/dist/types/components/Title/index.d.ts +2 -0
- package/dist/types/components/index.d.ts +38 -0
- package/dist/types/components/types.d.ts +24 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +111 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.1.0] - 2023-10-10
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- first release 0.1.0
|
package/README.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# UI-Kit library for Vchasno web applications
|
|
2
|
+
|
|
3
|
+
## 📦 Install
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @vchasno/ui-kit
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yarn add @vchasno/ui-kit
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 🔨 Usage
|
|
14
|
+
|
|
15
|
+
Supports React ^16.8.0 || ^17.0.0 || ^18.0.0
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import { Button } from '@vchasno/ui-kit';
|
|
20
|
+
|
|
21
|
+
const App = () => (
|
|
22
|
+
<>
|
|
23
|
+
<Button type="primary">PRESS ME</Button>
|
|
24
|
+
</>
|
|
25
|
+
);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Optionally you can import styles (use all or only what you need)
|
|
29
|
+
|
|
30
|
+
Suggestions:
|
|
31
|
+
- import reset styles
|
|
32
|
+
- import base styles
|
|
33
|
+
- import theme variables (will apply base theme)
|
|
34
|
+
- create your own theme variables override file (override only what you need)
|
|
35
|
+
|
|
36
|
+
```jsx
|
|
37
|
+
// index.tsx
|
|
38
|
+
import "@vchasno/ui-kit/dist/css/_reset.css"; // optional reset styles
|
|
39
|
+
import "@vchasno/ui-kit/dist/css/_base.css"; // optional base styles
|
|
40
|
+
import "@vchasno/ui-kit/dist/css/_theme.css"; // optional theme variables
|
|
41
|
+
import "src/styles/_theme-override.css"; // yuor own css file with theme variables override
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Styling and customization
|
|
45
|
+
|
|
46
|
+
`vchasno-ui` is using global styles with prefix `vchasno-ui-`
|
|
47
|
+
|
|
48
|
+
To customize styles you can use CSS variables and override them
|
|
49
|
+
|
|
50
|
+
```css
|
|
51
|
+
/* theme-override.css */
|
|
52
|
+
:root {
|
|
53
|
+
--transition-duration-sec: 0.5s; // default 0.3s
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
... or more specific styles
|
|
59
|
+
|
|
60
|
+
```css
|
|
61
|
+
/* button-override.css */
|
|
62
|
+
:global(.vchasno-ui-button.--sm) {
|
|
63
|
+
padding: 0 20px; // default 0 15px
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### TypeScript
|
|
68
|
+
|
|
69
|
+
`vchasno-ui` is written in TypeScript with complete definitions
|
|
70
|
+
|
|
71
|
+
## 🌍 Internationalization
|
|
72
|
+
|
|
73
|
+
Supports only Ukrainian language
|
|
74
|
+
|
|
75
|
+
## 🔗 Links
|
|
76
|
+
|
|
77
|
+
- [Home page](https://vchasno.ua/)
|
|
78
|
+
- [Change Log](CHANGELOG.md)
|
|
79
|
+
|
|
80
|
+
## Development
|
|
81
|
+
|
|
82
|
+
### Install dependencies
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npm install
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Add new component
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npm run storybook
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm run generate-component <ComponentName>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Go to `http://localhost:6006/` and start developing
|
|
99
|
+
|
|
100
|
+
To create story see [Storybook docs](https://storybook.js.org/docs/react/writing-stories/introduction) or other components
|
|
101
|
+
|
|
102
|
+
### Build storybook
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npm run build-storybook
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Build
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npm run build
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Publish
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npm publish
|
|
118
|
+
```
|
|
119
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
html,
|
|
2
|
+
body {
|
|
3
|
+
height: 100%;
|
|
4
|
+
font-family: Roboto, Arial, Tahoma, Helvetica, 'Liberation Sans', sans-serif;
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
line-height: 1.2;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
a {
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
text-decoration: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
a:hover {
|
|
15
|
+
text-decoration: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
a:active {
|
|
19
|
+
outline: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
h1,
|
|
23
|
+
h2,
|
|
24
|
+
h3,
|
|
25
|
+
h4,
|
|
26
|
+
h5,
|
|
27
|
+
h6 {
|
|
28
|
+
margin: 0;
|
|
29
|
+
font-size: inherit;
|
|
30
|
+
font-weight: inherit;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
td {
|
|
34
|
+
vertical-align: top;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
button::-moz-focus-inner {
|
|
38
|
+
padding: 0;
|
|
39
|
+
border: 0;
|
|
40
|
+
margin: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
input::placeholder {
|
|
44
|
+
user-select: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
input,
|
|
48
|
+
textarea,
|
|
49
|
+
button {
|
|
50
|
+
background: transparent;
|
|
51
|
+
font-family: Roboto, Arial, Tahoma, Helvetica, 'Liberation Sans', sans-serif;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
input:focus,
|
|
55
|
+
button:active,
|
|
56
|
+
button:focus,
|
|
57
|
+
textarea:focus {
|
|
58
|
+
outline: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
img {
|
|
62
|
+
display: inline-block;
|
|
63
|
+
max-width: 100%;
|
|
64
|
+
max-height: 100%;
|
|
65
|
+
vertical-align: middle;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
b,
|
|
69
|
+
strong {
|
|
70
|
+
font-weight: bold;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
i,
|
|
74
|
+
em {
|
|
75
|
+
font-style: italic;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
* {
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
html,
|
|
2
|
+
body,
|
|
3
|
+
div,
|
|
4
|
+
span,
|
|
5
|
+
applet,
|
|
6
|
+
object,
|
|
7
|
+
iframe,
|
|
8
|
+
h1,
|
|
9
|
+
h2,
|
|
10
|
+
h3,
|
|
11
|
+
h4,
|
|
12
|
+
h5,
|
|
13
|
+
h6,
|
|
14
|
+
p,
|
|
15
|
+
blockquote,
|
|
16
|
+
pre,
|
|
17
|
+
a,
|
|
18
|
+
abbr,
|
|
19
|
+
acronym,
|
|
20
|
+
address,
|
|
21
|
+
big,
|
|
22
|
+
cite,
|
|
23
|
+
code,
|
|
24
|
+
del,
|
|
25
|
+
dfn,
|
|
26
|
+
em,
|
|
27
|
+
img,
|
|
28
|
+
ins,
|
|
29
|
+
kbd,
|
|
30
|
+
q,
|
|
31
|
+
s,
|
|
32
|
+
samp,
|
|
33
|
+
small,
|
|
34
|
+
strike,
|
|
35
|
+
strong,
|
|
36
|
+
sub,
|
|
37
|
+
sup,
|
|
38
|
+
tt,
|
|
39
|
+
var,
|
|
40
|
+
b,
|
|
41
|
+
u,
|
|
42
|
+
i,
|
|
43
|
+
center,
|
|
44
|
+
dl,
|
|
45
|
+
dt,
|
|
46
|
+
dd,
|
|
47
|
+
ol,
|
|
48
|
+
ul,
|
|
49
|
+
li,
|
|
50
|
+
fieldset,
|
|
51
|
+
form,
|
|
52
|
+
label,
|
|
53
|
+
legend,
|
|
54
|
+
table,
|
|
55
|
+
caption,
|
|
56
|
+
tbody,
|
|
57
|
+
tfoot,
|
|
58
|
+
thead,
|
|
59
|
+
tr,
|
|
60
|
+
th,
|
|
61
|
+
td,
|
|
62
|
+
article,
|
|
63
|
+
aside,
|
|
64
|
+
canvas,
|
|
65
|
+
details,
|
|
66
|
+
embed,
|
|
67
|
+
figure,
|
|
68
|
+
figcaption,
|
|
69
|
+
footer,
|
|
70
|
+
header,
|
|
71
|
+
hgroup,
|
|
72
|
+
menu,
|
|
73
|
+
nav,
|
|
74
|
+
output,
|
|
75
|
+
ruby,
|
|
76
|
+
section,
|
|
77
|
+
summary,
|
|
78
|
+
time,
|
|
79
|
+
mark,
|
|
80
|
+
audio,
|
|
81
|
+
video,
|
|
82
|
+
input {
|
|
83
|
+
padding: 0;
|
|
84
|
+
border: 0;
|
|
85
|
+
margin: 0;
|
|
86
|
+
font-style: inherit;
|
|
87
|
+
font-weight: inherit;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
article,
|
|
91
|
+
aside,
|
|
92
|
+
details,
|
|
93
|
+
figcaption,
|
|
94
|
+
figure,
|
|
95
|
+
footer,
|
|
96
|
+
header,
|
|
97
|
+
hgroup,
|
|
98
|
+
menu,
|
|
99
|
+
nav,
|
|
100
|
+
section {
|
|
101
|
+
display: block;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
ol,
|
|
105
|
+
ul {
|
|
106
|
+
list-style: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
blockquote,
|
|
110
|
+
q {
|
|
111
|
+
quotes: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
blockquote::before,
|
|
115
|
+
blockquote::after,
|
|
116
|
+
q::before,
|
|
117
|
+
q::after {
|
|
118
|
+
content: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
table {
|
|
122
|
+
border-collapse: collapse;
|
|
123
|
+
border-spacing: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
html:focus,
|
|
127
|
+
body:focus,
|
|
128
|
+
div:focus,
|
|
129
|
+
span:focus,
|
|
130
|
+
applet:focus,
|
|
131
|
+
object:focus,
|
|
132
|
+
iframe:focus,
|
|
133
|
+
h1:focus,
|
|
134
|
+
h2:focus,
|
|
135
|
+
h3:focus,
|
|
136
|
+
h4:focus,
|
|
137
|
+
h5:focus,
|
|
138
|
+
h6:focus,
|
|
139
|
+
p:focus,
|
|
140
|
+
blockquote:focus,
|
|
141
|
+
pre:focus,
|
|
142
|
+
a:focus,
|
|
143
|
+
abbr:focus,
|
|
144
|
+
acronym:focus,
|
|
145
|
+
address:focus,
|
|
146
|
+
big:focus,
|
|
147
|
+
cite:focus,
|
|
148
|
+
code:focus,
|
|
149
|
+
del:focus,
|
|
150
|
+
dfn:focus,
|
|
151
|
+
em:focus,
|
|
152
|
+
img:focus,
|
|
153
|
+
ins:focus,
|
|
154
|
+
kbd:focus,
|
|
155
|
+
q:focus,
|
|
156
|
+
s:focus,
|
|
157
|
+
samp:focus,
|
|
158
|
+
small:focus,
|
|
159
|
+
strike:focus,
|
|
160
|
+
strong:focus,
|
|
161
|
+
sub:focus,
|
|
162
|
+
sup:focus,
|
|
163
|
+
tt:focus,
|
|
164
|
+
var:focus,
|
|
165
|
+
b:focus,
|
|
166
|
+
u:focus,
|
|
167
|
+
i:focus,
|
|
168
|
+
center:focus,
|
|
169
|
+
dl:focus,
|
|
170
|
+
dt:focus,
|
|
171
|
+
dd:focus,
|
|
172
|
+
ol:focus,
|
|
173
|
+
ul:focus,
|
|
174
|
+
li:focus,
|
|
175
|
+
fieldset:focus,
|
|
176
|
+
form:focus,
|
|
177
|
+
label:focus,
|
|
178
|
+
legend:focus,
|
|
179
|
+
table:focus,
|
|
180
|
+
caption:focus,
|
|
181
|
+
tbody:focus,
|
|
182
|
+
tfoot:focus,
|
|
183
|
+
thead:focus,
|
|
184
|
+
tr:focus,
|
|
185
|
+
th:focus,
|
|
186
|
+
td:focus,
|
|
187
|
+
article:focus,
|
|
188
|
+
aside:focus,
|
|
189
|
+
canvas:focus,
|
|
190
|
+
details:focus,
|
|
191
|
+
embed:focus,
|
|
192
|
+
figure:focus,
|
|
193
|
+
figcaption:focus,
|
|
194
|
+
footer:focus,
|
|
195
|
+
header:focus,
|
|
196
|
+
hgroup:focus,
|
|
197
|
+
menu:focus,
|
|
198
|
+
nav:focus,
|
|
199
|
+
output:focus,
|
|
200
|
+
ruby:focus,
|
|
201
|
+
section:focus,
|
|
202
|
+
summary:focus,
|
|
203
|
+
time:focus,
|
|
204
|
+
mark:focus,
|
|
205
|
+
audio:focus,
|
|
206
|
+
video:focus,
|
|
207
|
+
input:focus {
|
|
208
|
+
outline: 0;
|
|
209
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--transition-duration-sec: 0.3s;
|
|
3
|
+
--btn-default-bg: transparent;
|
|
4
|
+
--btn-default-hover-bg: #e1e4ff;
|
|
5
|
+
--btn-default-color: #6b8091;
|
|
6
|
+
--btn-default-hover-color: #604adf;
|
|
7
|
+
--btn-primary-bg: #604adf;
|
|
8
|
+
--btn-primary-hover-bg: #3f328c;
|
|
9
|
+
--btn-primary-color: #fff;
|
|
10
|
+
--btn-secondary-bg: #ffb200;
|
|
11
|
+
--btn-secondary-hover-bg: #f39300;
|
|
12
|
+
--btn-secondary-color: #fff;
|
|
13
|
+
--btn-light-bg: #fff;
|
|
14
|
+
--btn-light-hover-bg: rgb(96 74 223 / 20%);
|
|
15
|
+
--btn-light-color: #604adf;
|
|
16
|
+
--btn-font-size: 14px;
|
|
17
|
+
--btn-danger-color: #ef6562;
|
|
18
|
+
--btn-danger-bg: rgb(239 101 98 / 20%);
|
|
19
|
+
--btn-danger-hover-bg: #ef6562;
|
|
20
|
+
--btn-danger-hover-color: #fff;
|
|
21
|
+
--input-border-color-default: #b6cadb;
|
|
22
|
+
--input-border-color-focused: #6b5fff;
|
|
23
|
+
--input-color-error: #ff5937;
|
|
24
|
+
--input-bg-error: rgb(239 101 98 / 10%);
|
|
25
|
+
--input-font-size: 14px;
|
|
26
|
+
--input-font-color: #333;
|
|
27
|
+
--label-color-default: #6b8091;
|
|
28
|
+
--label-color-focused: #6b5fff;
|
|
29
|
+
--checkbox-bg-color: #604adf;
|
|
30
|
+
--checkbox-disabled-bg: #b6cadb;
|
|
31
|
+
--checkbox-border-color: #b6cadb;
|
|
32
|
+
--checkbox-icon-color: #fff;
|
|
33
|
+
--checkbox-font-size: 12px;
|
|
34
|
+
--select-option-bg-selected: #f3f6f8;
|
|
35
|
+
--select-option-color-selected: #333;
|
|
36
|
+
--select-menu-border-color: #6b5fff;
|
|
37
|
+
--calendar-color: #6b5fff;
|
|
38
|
+
--calendar-bg-hover: #ffb200;
|
|
39
|
+
--stepper-default-color: #dbe5ea;
|
|
40
|
+
--stepper-active-color: #6b5fff;
|
|
41
|
+
--text-primary-color: #333;
|
|
42
|
+
--text-secondary-color: #6b8091;
|
|
43
|
+
--text-success-color: #1cb800;
|
|
44
|
+
--text-warning-color: #ffb200;
|
|
45
|
+
--text-error-color: #ff5937;
|
|
46
|
+
--alert-info-color: #087dc1;
|
|
47
|
+
--alert-info-bg: #e9f4ff;
|
|
48
|
+
--alert-warning-color: #ffb200;
|
|
49
|
+
--alert-warning-bg: rgb(255 201 123 / 20%);
|
|
50
|
+
--alert-error-color: #ef6562;
|
|
51
|
+
--alert-error-bg: rgb(239 101 98 / 10%);
|
|
52
|
+
--alert-success-color: #1cb800;
|
|
53
|
+
--alert-success-bg: rgb(28 184 0 / 10%);
|
|
54
|
+
--tabs-active-color: #087dc1;
|
|
55
|
+
--pagination-border-color: #6b5fff;
|
|
56
|
+
--pagination-hover-bg: #e4e0ff;
|
|
57
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import React, { HTMLAttributes, ButtonHTMLAttributes, InputHTMLAttributes } from 'react';
|
|
2
|
+
import { MaskedInputProps } from 'react-text-mask';
|
|
3
|
+
import { Props } from 'react-select';
|
|
4
|
+
import { CreatableProps } from 'react-select/creatable';
|
|
5
|
+
import { GroupBase } from 'react-select/dist/declarations/src/types';
|
|
6
|
+
import { TextareaAutosizeProps } from 'react-textarea-autosize';
|
|
7
|
+
import { ReactDatePickerProps } from 'react-datepicker';
|
|
8
|
+
|
|
9
|
+
interface FlexBoxProps extends HTMLAttributes<HTMLElement> {
|
|
10
|
+
className?: string;
|
|
11
|
+
tagName?: keyof HTMLElementTagNameMap;
|
|
12
|
+
direction?: React.CSSProperties['flexDirection'];
|
|
13
|
+
gap?: number;
|
|
14
|
+
grow?: React.CSSProperties['flexGrow'];
|
|
15
|
+
shrink?: React.CSSProperties['flexShrink'];
|
|
16
|
+
wrap?: React.CSSProperties['flexWrap'];
|
|
17
|
+
align?: React.CSSProperties['alignItems'];
|
|
18
|
+
justify?: React.CSSProperties['justifyContent'];
|
|
19
|
+
}
|
|
20
|
+
declare const FlexBox: React.ForwardRefExoticComponent<FlexBoxProps & React.RefAttributes<HTMLElement>>;
|
|
21
|
+
|
|
22
|
+
interface Sizable {
|
|
23
|
+
size: 'sm' | 'md' | 'lg';
|
|
24
|
+
}
|
|
25
|
+
type TextType = 'secondary' | 'success' | 'warning' | 'danger' | 'default' | 'link' | 'likeLink';
|
|
26
|
+
interface LoadingFeedback {
|
|
27
|
+
/** індикатор процесу */
|
|
28
|
+
loading: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface ErrorFeedback {
|
|
31
|
+
/** для виведення тексту помилки */
|
|
32
|
+
error: string;
|
|
33
|
+
}
|
|
34
|
+
interface WithLabel {
|
|
35
|
+
/** Лейбл для інпуту */
|
|
36
|
+
label: string;
|
|
37
|
+
}
|
|
38
|
+
interface WithHint {
|
|
39
|
+
/** для виведення тексту підсказки */
|
|
40
|
+
hint: string;
|
|
41
|
+
}
|
|
42
|
+
interface EllipsisText {
|
|
43
|
+
/** для скорочення тексту і виведення 3 точок */
|
|
44
|
+
ellipsis?: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type ButtonTheme = "primary" | "secondary" | "transparent" | "light" | "danger";
|
|
48
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Partial<Sizable>, Partial<LoadingFeedback> {
|
|
49
|
+
className?: string;
|
|
50
|
+
theme?: ButtonTheme;
|
|
51
|
+
outline?: boolean;
|
|
52
|
+
wide?: boolean;
|
|
53
|
+
}
|
|
54
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
55
|
+
|
|
56
|
+
interface InputProps extends Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback> {
|
|
57
|
+
className?: string;
|
|
58
|
+
disabled?: boolean;
|
|
59
|
+
required?: boolean;
|
|
60
|
+
wide?: boolean;
|
|
61
|
+
startElement?: string | React.ReactElement;
|
|
62
|
+
endElement?: string | React.ReactElement;
|
|
63
|
+
labelProps?: InputHTMLAttributes<HTMLLabelElement>;
|
|
64
|
+
children: React.ReactHTMLElement<HTMLInputElement> | React.ReactElement | JSX.Element[];
|
|
65
|
+
}
|
|
66
|
+
declare const Input: React.FC<InputProps>;
|
|
67
|
+
|
|
68
|
+
interface InputMetaProps extends Partial<WithHint & ErrorFeedback> {
|
|
69
|
+
className?: string;
|
|
70
|
+
}
|
|
71
|
+
declare const InputMeta: React.FC<InputMetaProps>;
|
|
72
|
+
|
|
73
|
+
interface MaskInputProps extends MaskedInputProps, Omit<InputProps, 'children'> {
|
|
74
|
+
inputClassName?: string;
|
|
75
|
+
labelProps?: InputHTMLAttributes<HTMLLabelElement>;
|
|
76
|
+
}
|
|
77
|
+
declare const MaskInput: React.FC<MaskInputProps>;
|
|
78
|
+
|
|
79
|
+
interface PaginationProps {
|
|
80
|
+
className?: string;
|
|
81
|
+
initPage?: number;
|
|
82
|
+
total?: number;
|
|
83
|
+
hideOnSinglePage?: boolean;
|
|
84
|
+
onChange?: (page: number) => void;
|
|
85
|
+
current?: number;
|
|
86
|
+
scrollOnChange?: boolean;
|
|
87
|
+
}
|
|
88
|
+
declare const Pagination: React.FC<PaginationProps>;
|
|
89
|
+
|
|
90
|
+
interface SelectProps extends Props, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback> {
|
|
91
|
+
wide?: boolean;
|
|
92
|
+
dataQa?: string;
|
|
93
|
+
}
|
|
94
|
+
declare const Select: React.FC<SelectProps>;
|
|
95
|
+
|
|
96
|
+
interface Option {
|
|
97
|
+
readonly label: string;
|
|
98
|
+
readonly value: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
interface SelectCreatableProps extends CreatableProps<Option, false | true, GroupBase<Option>>, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback> {
|
|
102
|
+
wide?: boolean;
|
|
103
|
+
labelProps?: InputHTMLAttributes<HTMLLabelElement>;
|
|
104
|
+
dataQa?: string;
|
|
105
|
+
}
|
|
106
|
+
declare const SelectCreatable: React.FC<SelectCreatableProps>;
|
|
107
|
+
|
|
108
|
+
interface TextInputProps extends InputHTMLAttributes<HTMLInputElement>, Omit<InputProps, 'children'> {
|
|
109
|
+
inputClassName?: string;
|
|
110
|
+
labelProps?: InputHTMLAttributes<HTMLLabelElement>;
|
|
111
|
+
}
|
|
112
|
+
declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
113
|
+
|
|
114
|
+
interface TextProps extends HTMLAttributes<HTMLSpanElement>, EllipsisText {
|
|
115
|
+
type?: TextType;
|
|
116
|
+
code?: boolean;
|
|
117
|
+
underline?: boolean;
|
|
118
|
+
del?: boolean;
|
|
119
|
+
strong?: boolean;
|
|
120
|
+
className?: string;
|
|
121
|
+
required?: boolean;
|
|
122
|
+
}
|
|
123
|
+
declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
124
|
+
|
|
125
|
+
interface TitleProps extends EllipsisText, HTMLAttributes<HTMLHeadingElement> {
|
|
126
|
+
level?: 1 | 2 | 3 | 4 | 5;
|
|
127
|
+
className?: string;
|
|
128
|
+
}
|
|
129
|
+
declare const Title: React.ForwardRefExoticComponent<TitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
130
|
+
|
|
131
|
+
interface ParagraphProps extends EllipsisText, HTMLAttributes<HTMLParagraphElement> {
|
|
132
|
+
className?: string;
|
|
133
|
+
children: React.ReactNode;
|
|
134
|
+
}
|
|
135
|
+
declare const Paragraph: React.ForwardRefExoticComponent<ParagraphProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
136
|
+
|
|
137
|
+
interface TextAreaInputProps extends TextareaAutosizeProps, Omit<InputProps, 'children'> {
|
|
138
|
+
textareaClassName?: string;
|
|
139
|
+
labelProps?: InputHTMLAttributes<HTMLLabelElement>;
|
|
140
|
+
}
|
|
141
|
+
declare const TextAreaInput: React.ForwardRefExoticComponent<TextAreaInputProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
142
|
+
|
|
143
|
+
type AlertType = 'error' | 'warning' | 'success' | 'info';
|
|
144
|
+
type IconType = 'info' | 'cross' | 'error' | 'warning' | 'success';
|
|
145
|
+
interface AlertProps {
|
|
146
|
+
type?: AlertType;
|
|
147
|
+
icon?: IconType | React.ReactNode;
|
|
148
|
+
leftBorder?: boolean;
|
|
149
|
+
className?: string;
|
|
150
|
+
onClose?: VoidFunction;
|
|
151
|
+
close?: boolean;
|
|
152
|
+
wide?: boolean;
|
|
153
|
+
children: React.ReactNode;
|
|
154
|
+
}
|
|
155
|
+
declare const Alert: React.FC<AlertProps>;
|
|
156
|
+
|
|
157
|
+
interface DatePickerProps extends ReactDatePickerProps, Partial<LoadingFeedback & WithHint & ErrorFeedback> {
|
|
158
|
+
label?: string;
|
|
159
|
+
className?: string;
|
|
160
|
+
}
|
|
161
|
+
/** Компонент вводу дати/часу */
|
|
162
|
+
declare const DatePicker: React.FC<DatePickerProps>;
|
|
163
|
+
|
|
164
|
+
interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
165
|
+
/**
|
|
166
|
+
* CSS color #fff - default
|
|
167
|
+
*/
|
|
168
|
+
color?: string;
|
|
169
|
+
/**
|
|
170
|
+
* CSS width values like 10em | 10px | 50%
|
|
171
|
+
*/
|
|
172
|
+
width?: React.CSSProperties['width'];
|
|
173
|
+
/**
|
|
174
|
+
* CSS height values like 10em | 10px | 50%
|
|
175
|
+
*/
|
|
176
|
+
height?: React.CSSProperties['height'];
|
|
177
|
+
}
|
|
178
|
+
declare const Spinner: React.FC<SpinnerProps>;
|
|
179
|
+
|
|
180
|
+
interface SwitcherProps {
|
|
181
|
+
className?: string;
|
|
182
|
+
height?: number;
|
|
183
|
+
color?: string;
|
|
184
|
+
checked?: boolean;
|
|
185
|
+
onChecked?: (checked: boolean) => void;
|
|
186
|
+
}
|
|
187
|
+
declare const Switcher: React.ForwardRefExoticComponent<SwitcherProps & React.RefAttributes<HTMLInputElement>>;
|
|
188
|
+
|
|
189
|
+
interface Tab<T> {
|
|
190
|
+
key: T;
|
|
191
|
+
children: React.ReactNode;
|
|
192
|
+
label: string | React.ReactNode;
|
|
193
|
+
disabled?: boolean;
|
|
194
|
+
className?: string;
|
|
195
|
+
}
|
|
196
|
+
interface TabsProps<T> {
|
|
197
|
+
items: Tab<T>[];
|
|
198
|
+
activeTab?: T;
|
|
199
|
+
defaultActiveKey?: T;
|
|
200
|
+
onChange?: (key: T) => void;
|
|
201
|
+
className?: string;
|
|
202
|
+
isPending?: boolean;
|
|
203
|
+
}
|
|
204
|
+
declare const Tabs: <T extends string>({ onChange, items, defaultActiveKey, activeTab, className, isPending, }: TabsProps<T>) => React.JSX.Element;
|
|
205
|
+
|
|
206
|
+
interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement>, Partial<LoadingFeedback> {
|
|
207
|
+
className?: string;
|
|
208
|
+
label?: string;
|
|
209
|
+
disabled?: boolean;
|
|
210
|
+
partial?: boolean;
|
|
211
|
+
}
|
|
212
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
213
|
+
|
|
214
|
+
export { Alert, type AlertProps, Button, type ButtonProps, Checkbox, type CheckboxProps, DatePicker, type DatePickerProps, FlexBox, type FlexBoxProps, Input, InputMeta, type InputMetaProps, type InputProps, MaskInput, type MaskInputProps, Pagination, type PaginationProps, Paragraph, type ParagraphProps, Select, SelectCreatable, type SelectCreatableProps, type SelectProps, Spinner, type SpinnerProps, Switcher, type SwitcherProps, Tabs, type TabsProps, Text, TextAreaInput, type TextAreaInputProps, TextInput, type TextInputProps, type TextProps, Title, type TitleProps };
|