kamotive_ui 1.2.5 → 1.2.7
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/dist/Intro/Welcome.module.css +2 -2
- package/dist/components/ColorPicker/ColorPicker.module.css +3 -3
- package/dist/components/Dropdown/Dropdown.js +116 -45
- package/dist/components/Dropdown/Dropdown.module.css +30 -3
- package/dist/components/Input/Input.module.css +3 -3
- package/dist/components/ProgressBar/ProgressBar.module.css +1 -1
- package/dist/components/Tab/Tab.js +2 -2
- package/dist/components/Tabs/Tabs.module.css +1 -1
- package/dist/components/Tag/Tag.module.css +1 -1
- package/dist/components/ToggleButton/ToggleButton.module.css +1 -1
- package/dist/components/Typography/Typography.module.css +25 -83
- package/dist/components/Typography/enums.d.ts +4 -0
- package/dist/components/Typography/enums.js +4 -0
- package/dist/fonts.css +4 -3
- package/dist/types/index.d.ts +27 -18
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.h1{
|
|
2
|
-
font-family:
|
|
2
|
+
font-family: var(--font-family);
|
|
3
3
|
font-style: normal;
|
|
4
4
|
font-weight: 600;
|
|
5
5
|
line-height: 16.5px;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
margin: 20px;
|
|
9
9
|
}
|
|
10
10
|
.body {
|
|
11
|
-
font-family:
|
|
11
|
+
font-family: var(--font-family);
|
|
12
12
|
font-style: normal;
|
|
13
13
|
font-weight: 400;
|
|
14
14
|
line-height: 16.5px;
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
}
|
|
164
164
|
/* Для всех инпутов в пикере */
|
|
165
165
|
:global(.w-color-chrome) :global(.w-color-editable-input) input {
|
|
166
|
-
font-family:
|
|
166
|
+
font-family: var(--font-family) !important;
|
|
167
167
|
font-style: normal !important;
|
|
168
168
|
font-weight: 400 !important;
|
|
169
169
|
line-height: 14px !important;
|
|
@@ -204,7 +204,7 @@ border-left: none !important;
|
|
|
204
204
|
}
|
|
205
205
|
/* Для лейблов */
|
|
206
206
|
:global(.w-color-chrome-fields) :global(.w-color-editable-input) label {
|
|
207
|
-
font-family:
|
|
207
|
+
font-family: var(--font-family) !important;
|
|
208
208
|
font-style: normal !important;
|
|
209
209
|
font-weight: 400 !important;
|
|
210
210
|
line-height: 16.5px !important;
|
|
@@ -240,7 +240,7 @@ border-left: none !important;
|
|
|
240
240
|
.hex > :global(.w-color-editable-input) > input {
|
|
241
241
|
/* padding: 0 !important; */
|
|
242
242
|
font-size: 12px !important;
|
|
243
|
-
font-family:
|
|
243
|
+
font-family: var(--font-family) !important;
|
|
244
244
|
padding: 5px !important;
|
|
245
245
|
width: 70px !important;
|
|
246
246
|
height: 45px !important;
|
|
@@ -83,22 +83,77 @@ export const DropdownListItem = ({ item, getOptionLabel, size = 'md', selectedIt
|
|
|
83
83
|
return (React.createElement(DropdownListItem, { key: (_a = child === null || child === void 0 ? void 0 : child.key) !== null && _a !== void 0 ? _a : childIndex, item: child, getOptionLabel: getOptionLabel, size: size, selectedItem: selectedItem, onChange: onChange, isActive: activeIndex === index, activeIndex: activeIndex, index: childIndex }));
|
|
84
84
|
})))));
|
|
85
85
|
};
|
|
86
|
-
export const Dropdown = ({ id, label, placeholder,
|
|
87
|
-
var _a;
|
|
86
|
+
export const Dropdown = ({ options, id, label, placeholder, required = false, value, defaultValue, onChange, getOptionLabel, variant = 'text', size = 'lg', style, className, isLeftLabel = false, isDivider = false, disabled = false, readOnly = false, isOpened = false, error = false, helperText, onClick, onBlur, onFocus, onClose, clearable = true, enableAutocomplete = false, noOptionsText = 'Нет вариантов для выбора', }) => {
|
|
88
87
|
const [isOpen, setIsOpen] = useState(isOpened);
|
|
89
88
|
const [modifiedOptions, setModifiedOptions] = useState([]);
|
|
90
89
|
const [selectedItem, setSelectedItem] = useState(null);
|
|
91
90
|
const [errorInput, setErrorInput] = useState(false);
|
|
92
91
|
const [errorInputHelperText, setErrorInputHelperText] = useState(helperText);
|
|
93
92
|
const [activeIndex, setActiveIndex] = useState(-1);
|
|
93
|
+
const [searchValue, setSearchValue] = useState('');
|
|
94
|
+
const [filteredOptions, setFilteredOptions] = useState([]);
|
|
95
|
+
const inputRef = useRef(null);
|
|
94
96
|
const containerRef = useRef(null);
|
|
95
97
|
const [containerWidth, setContainerWidth] = useState(undefined);
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
const wrapperClassess = classNames(className, {
|
|
99
|
+
[styles['dropdown--container']]: !isLeftLabel,
|
|
100
|
+
[styles['dropdown--container-left']]: isLeftLabel,
|
|
101
|
+
[styles['dropdown--container-label']]: label && !isLeftLabel && !required,
|
|
102
|
+
[styles['dropdown--container-helperText']]: errorInput,
|
|
103
|
+
});
|
|
104
|
+
const buttonClassess = classNames(styles.button, styles[`button--${size}`], {
|
|
105
|
+
[styles['button-item--selected']]: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) && !disabled,
|
|
106
|
+
[styles['button--readOnly']]: readOnly,
|
|
107
|
+
[styles['button--disabled']]: disabled,
|
|
108
|
+
[styles['button--error']]: errorInput,
|
|
109
|
+
});
|
|
110
|
+
const dropdownClassess = classNames(styles.dropdown, className, {
|
|
111
|
+
[styles['dropdown--disabled']]: disabled,
|
|
112
|
+
});
|
|
113
|
+
const labelClasses = classNames(styles.label, styles[size], {
|
|
114
|
+
[styles['label--default']]: !isLeftLabel,
|
|
115
|
+
[styles['label--left']]: isLeftLabel,
|
|
116
|
+
[styles['label--required']]: required,
|
|
117
|
+
});
|
|
118
|
+
const selectedItemClassess = classNames({
|
|
119
|
+
[styles['item-selected']]: selectedItem,
|
|
120
|
+
[styles['item-placeholder']]: !selectedItem && ((placeholder !== null && placeholder !== void 0 ? placeholder : label) || (!placeholder && !label)),
|
|
121
|
+
[styles['button--icons--item-selected']]: variant === 'icons' && (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.icon),
|
|
122
|
+
});
|
|
123
|
+
// обновляет значения searchValue и filteredOptions
|
|
124
|
+
const setAutocompleteValues = (value) => {
|
|
125
|
+
setSearchValue(value);
|
|
126
|
+
// фильтрация по введенному значению
|
|
127
|
+
if (modifiedOptions && modifiedOptions.length > 0) {
|
|
128
|
+
const filtered = modifiedOptions.filter((option) => {
|
|
129
|
+
if (!option || !option.value)
|
|
130
|
+
return false;
|
|
131
|
+
const optionValue = String(option.value).toLowerCase();
|
|
132
|
+
return optionValue.includes(value.toLowerCase());
|
|
133
|
+
});
|
|
134
|
+
setFilteredOptions(filtered);
|
|
135
|
+
setActiveIndex(filtered && filtered.length > 0 ? 0 : -1);
|
|
100
136
|
}
|
|
101
137
|
};
|
|
138
|
+
const handleToggle = useCallback((event) => {
|
|
139
|
+
event.preventDefault();
|
|
140
|
+
event.stopPropagation();
|
|
141
|
+
const newIsOpen = !isOpen;
|
|
142
|
+
setIsOpen(newIsOpen);
|
|
143
|
+
if (newIsOpen && enableAutocomplete) {
|
|
144
|
+
const value = (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) ? selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value.toString() : searchValue;
|
|
145
|
+
setSearchValue(value);
|
|
146
|
+
setFilteredOptions(modifiedOptions);
|
|
147
|
+
requestAnimationFrame(() => {
|
|
148
|
+
if (inputRef.current) {
|
|
149
|
+
inputRef.current.focus();
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
else if (!newIsOpen) {
|
|
154
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(event);
|
|
155
|
+
}
|
|
156
|
+
}, [isOpen, enableAutocomplete, searchValue, selectedItem, modifiedOptions, onClose]);
|
|
102
157
|
const onChangeHandler = (event, item) => {
|
|
103
158
|
event.preventDefault();
|
|
104
159
|
event.stopPropagation();
|
|
@@ -116,6 +171,12 @@ export const Dropdown = ({ id, label, placeholder, size = 'lg', options, getOpti
|
|
|
116
171
|
setErrorInput(true);
|
|
117
172
|
}
|
|
118
173
|
};
|
|
174
|
+
const handleSearchChange = (event) => {
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
event.stopPropagation();
|
|
177
|
+
const value = event.target.value;
|
|
178
|
+
setAutocompleteValues(value);
|
|
179
|
+
};
|
|
119
180
|
//для выбора опции из списка с клавиатуры
|
|
120
181
|
const handleKeyDown = (event) => {
|
|
121
182
|
if (!isOpen) {
|
|
@@ -127,6 +188,14 @@ export const Dropdown = ({ id, label, placeholder, size = 'lg', options, getOpti
|
|
|
127
188
|
}
|
|
128
189
|
return;
|
|
129
190
|
}
|
|
191
|
+
if (enableAutocomplete &&
|
|
192
|
+
event.target instanceof HTMLInputElement &&
|
|
193
|
+
(event.key !== 'ArrowDown' &&
|
|
194
|
+
event.key !== 'ArrowUp' &&
|
|
195
|
+
event.key !== 'Enter' &&
|
|
196
|
+
event.key !== 'Escape')) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
130
199
|
switch (event.key) {
|
|
131
200
|
case 'ArrowDown':
|
|
132
201
|
event.preventDefault();
|
|
@@ -161,7 +230,11 @@ export const Dropdown = ({ id, label, placeholder, size = 'lg', options, getOpti
|
|
|
161
230
|
? checkItem(defaultValue)
|
|
162
231
|
: null;
|
|
163
232
|
setSelectedItem(startValue !== null && startValue !== void 0 ? startValue : null);
|
|
164
|
-
|
|
233
|
+
if (!enableAutocomplete) {
|
|
234
|
+
setIsOpen(false);
|
|
235
|
+
}
|
|
236
|
+
setSearchValue("");
|
|
237
|
+
setFilteredOptions(modifiedOptions);
|
|
165
238
|
onChange === null || onChange === void 0 ? void 0 : onChange(event, startValue !== null && startValue !== void 0 ? startValue : null);
|
|
166
239
|
onClose === null || onClose === void 0 ? void 0 : onClose(event);
|
|
167
240
|
setActiveIndex(-1);
|
|
@@ -170,36 +243,37 @@ export const Dropdown = ({ id, label, placeholder, size = 'lg', options, getOpti
|
|
|
170
243
|
setErrorInputHelperText(helperText !== null && helperText !== void 0 ? helperText : 'Поле обязательно для заполнения');
|
|
171
244
|
}
|
|
172
245
|
};
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
[styles['button--icons--item-selected']]: variant === 'icons' && (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.icon),
|
|
197
|
-
});
|
|
246
|
+
const getTextField = () => {
|
|
247
|
+
var _a;
|
|
248
|
+
return (React.createElement("div", { className: selectedItemClassess },
|
|
249
|
+
variant === 'icons' &&
|
|
250
|
+
(selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.icon) &&
|
|
251
|
+
React.cloneElement(selectedItem.icon, {
|
|
252
|
+
strokeWidth: size === 'lg' ? '0.5' : size === 'md' ? '0.3' : '0.0',
|
|
253
|
+
}),
|
|
254
|
+
isOpen && enableAutocomplete ? (React.createElement("input", { ref: inputRef, type: "text", value: searchValue, className: styles.inlineSearchInput, onChange: handleSearchChange, placeholder: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) ? selectedItem.value.toString() : 'Поиск...', onClick: (e) => {
|
|
255
|
+
e.stopPropagation();
|
|
256
|
+
e.preventDefault();
|
|
257
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
258
|
+
e.currentTarget.focus();
|
|
259
|
+
}, onMouseDown: (e) => {
|
|
260
|
+
e.stopPropagation();
|
|
261
|
+
}, onFocus: (e) => {
|
|
262
|
+
e.stopPropagation();
|
|
263
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
264
|
+
}, onBlur: (e) => {
|
|
265
|
+
e.stopPropagation();
|
|
266
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
267
|
+
}, onKeyDown: handleKeyDown, autoFocus: true })) : selectedItem ? (selectedItem.value) : (searchValue || ((_a = placeholder !== null && placeholder !== void 0 ? placeholder : label) !== null && _a !== void 0 ? _a : 'Выберите значение'))));
|
|
268
|
+
};
|
|
198
269
|
const getDropdownMenu = () => {
|
|
199
|
-
const
|
|
270
|
+
const optionsToRender = enableAutocomplete && searchValue
|
|
271
|
+
? filteredOptions
|
|
272
|
+
: modifiedOptions;
|
|
273
|
+
const menu = isOpen && (React.createElement("div", { className: dropdownClassess }, optionsToRender && optionsToRender.length > 0 ? (optionsToRender.map((optionsToRender, index) => {
|
|
200
274
|
var _a;
|
|
201
|
-
return (React.createElement(DropdownListItem, { key: (_a =
|
|
202
|
-
})) : (React.createElement("div", { className: styles['
|
|
275
|
+
return (React.createElement(DropdownListItem, { key: (_a = optionsToRender === null || optionsToRender === void 0 ? void 0 : optionsToRender.key) !== null && _a !== void 0 ? _a : index, item: optionsToRender, getOptionLabel: getOptionLabel, size: size, selectedItem: selectedItem, variant: variant, onChange: onChangeHandler, isActive: activeIndex === index, activeIndex: activeIndex, index: index }));
|
|
276
|
+
})) : (React.createElement("div", { className: `${styles['item-container']} ${styles['item-block']}`, style: { paddingLeft: "15px" } }, noOptionsText))));
|
|
203
277
|
return isOpen ? menu : null;
|
|
204
278
|
};
|
|
205
279
|
useEffect(() => {
|
|
@@ -254,21 +328,18 @@ export const Dropdown = ({ id, label, placeholder, size = 'lg', options, getOpti
|
|
|
254
328
|
else {
|
|
255
329
|
setSelectedItem(null);
|
|
256
330
|
}
|
|
257
|
-
}, [value, defaultValue
|
|
331
|
+
}, [value, defaultValue]);
|
|
258
332
|
useEffect(() => {
|
|
259
333
|
setErrorInput(error);
|
|
260
334
|
}, [error]);
|
|
261
|
-
|
|
335
|
+
useEffect(() => {
|
|
336
|
+
setFilteredOptions(modifiedOptions);
|
|
337
|
+
}, [modifiedOptions]);
|
|
338
|
+
return (React.createElement("div", { id: id, className: wrapperClassess, ref: containerRef, onClick: onClick, style: style ? style : { width: isLeftLabel && containerWidth ? `${containerWidth}px` : '100%' } },
|
|
262
339
|
label && (React.createElement(Typography, { variant: "Caption", className: labelClasses }, label)),
|
|
263
340
|
React.createElement("button", { className: buttonClassess, onClick: readOnly ? undefined : handleToggle, disabled: disabled, tabIndex: 0, onKeyDown: handleKeyDown },
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
(selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.icon) &&
|
|
267
|
-
React.cloneElement(selectedItem.icon, {
|
|
268
|
-
strokeWidth: size === 'lg' ? '0.5' : size === 'md' ? '0.3' : '0.0',
|
|
269
|
-
}),
|
|
270
|
-
selectedItem ? selectedItem.value : ((_a = placeholder !== null && placeholder !== void 0 ? placeholder : label) !== null && _a !== void 0 ? _a : 'Выберите значение')),
|
|
271
|
-
clearable && !readOnly && !disabled && selectedItem && (React.createElement("div", { className: styles.resetButton },
|
|
341
|
+
getTextField(),
|
|
342
|
+
clearable && !readOnly && !disabled && (selectedItem || enableAutocomplete && searchValue) && (React.createElement("div", { className: styles.resetButton },
|
|
272
343
|
React.createElement(IconClose10, { strokeWidth: "0.2", htmlColor: "var(--text-light)", onClick: handleReset }))),
|
|
273
344
|
React.createElement("div", { className: styles.dropdownIcon }, !isOpen ? (React.createElement(ChevronDown10, { strokeWidth: size === 'lg' ? '0.5' : '0.3' })) : (React.createElement(ChevronUp10, { strokeWidth: size === 'lg' ? '0.5' : '0.3' }))),
|
|
274
345
|
getDropdownMenu()),
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.button {
|
|
32
|
-
font-family: var(--font-family
|
|
32
|
+
font-family: var(--font-family);
|
|
33
33
|
font-style: normal;
|
|
34
34
|
font-weight: 400;
|
|
35
35
|
line-height: 16.5px;
|
|
@@ -143,6 +143,19 @@
|
|
|
143
143
|
overflow-x: hidden;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
.inlineSearchInput {
|
|
147
|
+
border: none;
|
|
148
|
+
outline: none;
|
|
149
|
+
background: transparent;
|
|
150
|
+
font-size: inherit;
|
|
151
|
+
font-family: inherit;
|
|
152
|
+
color: inherit;
|
|
153
|
+
padding: 0;
|
|
154
|
+
cursor: text;
|
|
155
|
+
pointer-events: auto;
|
|
156
|
+
text-align: left;
|
|
157
|
+
}
|
|
158
|
+
|
|
146
159
|
.item--container {
|
|
147
160
|
padding: 0.5em 0.5em;
|
|
148
161
|
width: 87%;
|
|
@@ -195,6 +208,7 @@
|
|
|
195
208
|
|
|
196
209
|
.label {
|
|
197
210
|
transition: 0.3ms ease-out;
|
|
211
|
+
font-weight: 600;
|
|
198
212
|
/* color: var(--text-grey); */
|
|
199
213
|
}
|
|
200
214
|
.label--default {
|
|
@@ -205,7 +219,7 @@
|
|
|
205
219
|
overflow: hidden;
|
|
206
220
|
text-overflow: ellipsis;
|
|
207
221
|
max-width: calc(100% - 32px);
|
|
208
|
-
color: var(--text-
|
|
222
|
+
color: var(--text-dark);
|
|
209
223
|
}
|
|
210
224
|
.label--default.lg {
|
|
211
225
|
font-size: 12px;
|
|
@@ -240,14 +254,27 @@
|
|
|
240
254
|
|
|
241
255
|
.item-selected {
|
|
242
256
|
color: var(--text-dark);
|
|
243
|
-
|
|
257
|
+
width: 80%;
|
|
244
258
|
overflow: hidden;
|
|
245
259
|
text-overflow: ellipsis;
|
|
260
|
+
white-space: nowrap;
|
|
261
|
+
min-width: 0;
|
|
262
|
+
text-align: left;
|
|
263
|
+
position: relative;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.item-selected .inlineSearchInput {
|
|
267
|
+
text-align: left;
|
|
268
|
+
direction: ltr;
|
|
269
|
+
width: 100%;
|
|
270
|
+
overflow: visible;
|
|
246
271
|
}
|
|
247
272
|
|
|
248
273
|
.item-placeholder {
|
|
249
274
|
color: var(--text-grey);
|
|
250
275
|
transition: 0.3ms ease-out;
|
|
276
|
+
display: flex;
|
|
277
|
+
justify-content: flex-start;
|
|
251
278
|
}
|
|
252
279
|
|
|
253
280
|
.helperText.md {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.input {
|
|
22
|
-
font-family: var(--font-family
|
|
22
|
+
font-family: var(--font-family);
|
|
23
23
|
font-style: normal;
|
|
24
24
|
font-weight: 400;
|
|
25
25
|
position: relative;
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
|
|
104
104
|
.label {
|
|
105
105
|
line-height: 14px;
|
|
106
|
-
font-weight:
|
|
106
|
+
font-weight: 600;
|
|
107
107
|
transition: 0.3ms ease-out;
|
|
108
108
|
/* color: var(--text-grey); */
|
|
109
109
|
}
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
overflow: hidden;
|
|
116
116
|
text-overflow: ellipsis;
|
|
117
117
|
max-width: calc(100% - 32px);
|
|
118
|
-
color: var(--text-
|
|
118
|
+
color: var(--text-dark);
|
|
119
119
|
}
|
|
120
120
|
.label--default .lg {
|
|
121
121
|
font-size: 12px;
|
|
@@ -3,7 +3,7 @@ import styles from './Tab.module.css';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
;
|
|
5
5
|
import { Typography } from '../Typography/Typography';
|
|
6
|
-
export const Tab = ({ value, onClick, label, selected, disabled = false }) => {
|
|
6
|
+
export const Tab = ({ value, onClick, onMouseEnter, label, selected, disabled = false }) => {
|
|
7
7
|
const handleClick = (e) => {
|
|
8
8
|
if (onClick && value && !disabled) {
|
|
9
9
|
onClick(value);
|
|
@@ -12,6 +12,6 @@ export const Tab = ({ value, onClick, label, selected, disabled = false }) => {
|
|
|
12
12
|
return (React.createElement("button", { role: "tab", "aria-selected": selected, "aria-disabled": disabled, value: value, className: classNames(styles.tab, {
|
|
13
13
|
[styles['selected']]: selected,
|
|
14
14
|
[styles['disabled']]: disabled,
|
|
15
|
-
}), onClick: handleClick },
|
|
15
|
+
}), onClick: handleClick, onMouseEnter: onMouseEnter },
|
|
16
16
|
React.createElement(Typography, { variant: selected ? 'Body2-Medium' : "Body2" }, label)));
|
|
17
17
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
.typography--variant-Heading1 {
|
|
3
|
-
font-family: var(--font-family
|
|
3
|
+
font-family: var(--font-family);
|
|
4
4
|
font-size: var(--font-size-48);
|
|
5
5
|
font-weight: var(--font-weight-bold);
|
|
6
6
|
line-height: var(--lineHeight-48);
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
text-decoration: none;
|
|
9
9
|
}
|
|
10
10
|
.typography--variant-Heading2 {
|
|
11
|
-
font-family: var(--font-family
|
|
11
|
+
font-family: var(--font-family);
|
|
12
12
|
font-size: var(--font-size-36);
|
|
13
13
|
font-weight: var(--font-weight-bold);
|
|
14
14
|
line-height: var(--lineHeight-36);
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
text-decoration: none;
|
|
17
17
|
}
|
|
18
18
|
.typography--variant-Heading3 {
|
|
19
|
-
font-family: var(--font-family
|
|
19
|
+
font-family: var(--font-family);
|
|
20
20
|
font-size: var(--font-size-24);
|
|
21
21
|
font-weight: var(--font-weight-bold);
|
|
22
22
|
line-height: var(--lineHeight-24);
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
text-decoration: none;
|
|
25
25
|
}
|
|
26
26
|
.typography--variant-Heading4 {
|
|
27
|
-
font-family: var(--font-family
|
|
27
|
+
font-family: var(--font-family);
|
|
28
28
|
font-size: var(--font-size-20);
|
|
29
29
|
font-weight: var(--font-weight-bold);
|
|
30
30
|
line-height: var(--lineHeight-20);
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
text-decoration: none;
|
|
33
33
|
}
|
|
34
34
|
.typography--variant-Subheading1 {
|
|
35
|
-
font-family: var(--font-family
|
|
35
|
+
font-family: var(--font-family);
|
|
36
36
|
font-size: var(--font-size-36);
|
|
37
37
|
font-weight: var(--font-weight-medium);
|
|
38
38
|
line-height: var(--lineHeight-36);
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
text-decoration: none;
|
|
41
41
|
}
|
|
42
42
|
.typography--variant-Subheading2 {
|
|
43
|
-
font-family: var(--font-family
|
|
43
|
+
font-family: var(--font-family);
|
|
44
44
|
font-size: var(--font-size-24);
|
|
45
45
|
font-weight: var(--font-weight-regular);
|
|
46
46
|
line-height: var(--lineHeight-24);
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
text-decoration: none;
|
|
49
49
|
}
|
|
50
50
|
.typography--variant-Subheading2-Medium {
|
|
51
|
-
font-family: var(--font-family
|
|
51
|
+
font-family: var(--font-family);
|
|
52
52
|
font-size: var(--font-size-24);
|
|
53
53
|
font-weight: var(--font-weight-medium);
|
|
54
54
|
line-height: var(--lineHeight-24);
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
text-decoration: none;
|
|
57
57
|
}
|
|
58
58
|
.typography--variant-Subheading3 {
|
|
59
|
-
font-family: var(--font-family
|
|
59
|
+
font-family: var(--font-family);
|
|
60
60
|
font-size: var(--font-size-20);
|
|
61
61
|
font-weight: var(--font-weight-regular);
|
|
62
62
|
line-height: var(--lineHeight-20);
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
text-decoration: none;
|
|
65
65
|
}
|
|
66
66
|
.typography--variant-Subheading3-Medium {
|
|
67
|
-
font-family: var(--font-family
|
|
67
|
+
font-family: var(--font-family);
|
|
68
68
|
font-size: var(--font-size-20);
|
|
69
69
|
font-weight: var(--font-weight-medium);
|
|
70
70
|
line-height: var(--lineHeight-20);
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
text-decoration: none;
|
|
73
73
|
}
|
|
74
74
|
.typography--variant-Body {
|
|
75
|
-
font-family: var(--font-family
|
|
75
|
+
font-family: var(--font-family);
|
|
76
76
|
font-size: var(--font-size-18);
|
|
77
77
|
font-weight: var(--font-weight-regular);
|
|
78
78
|
line-height: var(--lineHeight-18);
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
text-decoration: none;
|
|
81
81
|
}
|
|
82
82
|
.typography--variant-Body-Medium {
|
|
83
|
-
font-family: var(--font-family
|
|
83
|
+
font-family: var(--font-family);
|
|
84
84
|
font-size: var(--font-size-18);
|
|
85
85
|
font-weight: var(--font-weight-meduim);
|
|
86
86
|
line-height: var(--lineHeight-18);
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
text-decoration: none;
|
|
89
89
|
}
|
|
90
90
|
.typography--variant-Body-Bold{
|
|
91
|
-
font-family: var(--font-family
|
|
91
|
+
font-family: var(--font-family);
|
|
92
92
|
font-size: var(--font-size-18);
|
|
93
93
|
font-weight: var(--font-weight-bold);
|
|
94
94
|
line-height: var(--lineHeight-18);
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
text-decoration: none;
|
|
97
97
|
}
|
|
98
98
|
.typography--variant-Body1-Light {
|
|
99
|
-
font-family: var(--font-family
|
|
99
|
+
font-family: var(--font-family);
|
|
100
100
|
font-size: var(--font-size-16);
|
|
101
101
|
font-weight: var(--font-weight-light);
|
|
102
102
|
line-height: var(--lineHeight-16);
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
text-decoration: none;
|
|
105
105
|
}
|
|
106
106
|
.typography--variant-Body1 {
|
|
107
|
-
font-family: var(--font-family
|
|
107
|
+
font-family: var(--font-family);
|
|
108
108
|
font-size: var(--font-size-16);
|
|
109
109
|
font-weight: var(--font-weight-regular);
|
|
110
110
|
line-height: var(--lineHeight-16);
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
text-decoration: none;
|
|
113
113
|
}
|
|
114
114
|
.typography--variant-Body1-Medium {
|
|
115
|
-
font-family: var(--font-family
|
|
115
|
+
font-family: var(--font-family);
|
|
116
116
|
font-size: var(--font-size-16);
|
|
117
117
|
font-weight: var(--font-weight-medium);
|
|
118
118
|
line-height: var(--lineHeight-16);
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
text-decoration: none;
|
|
121
121
|
}
|
|
122
122
|
.typography--variant-Body1-SemiBold{
|
|
123
|
-
font-family: var(--font-family
|
|
123
|
+
font-family: var(--font-family);
|
|
124
124
|
font-size: var(--font-size-16);
|
|
125
125
|
font-weight: var(--font-weight-semiBold);
|
|
126
126
|
line-height: var(--lineHeight-16);
|
|
@@ -128,31 +128,15 @@
|
|
|
128
128
|
text-decoration: none;
|
|
129
129
|
}
|
|
130
130
|
.typography--variant-Body1-Bold{
|
|
131
|
-
font-family: var(--font-family
|
|
131
|
+
font-family: var(--font-family);
|
|
132
132
|
font-size: var(--font-size-16);
|
|
133
133
|
font-weight: var(--font-weight-bold);
|
|
134
134
|
line-height: var(--lineHeight-16);
|
|
135
135
|
letter-spacing: var(--letterSpacing);
|
|
136
136
|
text-decoration: none;
|
|
137
137
|
}
|
|
138
|
-
.typography--variant-Body1Mono-Regular {
|
|
139
|
-
font-family: var(--font-family-secondary);
|
|
140
|
-
font-size: var(--font-size-16);
|
|
141
|
-
font-weight: var(--font-weight-regular);
|
|
142
|
-
line-height: var(--lineHeight-16);
|
|
143
|
-
letter-spacing: var(--letterSpacing);
|
|
144
|
-
text-decoration: none;
|
|
145
|
-
}
|
|
146
|
-
.typography--variant-Body1Mono-Bold {
|
|
147
|
-
font-family: var(--font-family-secondary);
|
|
148
|
-
font-size: var(--font-size-16);
|
|
149
|
-
font-weight: var(--font-weight-semiBold);
|
|
150
|
-
line-height: var(--lineHeight-16);
|
|
151
|
-
letter-spacing: var(--letterSpacing);
|
|
152
|
-
text-decoration: none;
|
|
153
|
-
}
|
|
154
138
|
.typography--variant-Body2-Light {
|
|
155
|
-
font-family: var(--font-family
|
|
139
|
+
font-family: var(--font-family);
|
|
156
140
|
font-size: var(--font-size-14);
|
|
157
141
|
font-weight: var(--font-weight-light);
|
|
158
142
|
line-height: var(--lineHeight-14);
|
|
@@ -160,7 +144,7 @@
|
|
|
160
144
|
text-decoration: none;
|
|
161
145
|
}
|
|
162
146
|
.typography--variant-Body2 {
|
|
163
|
-
font-family: var(--font-family
|
|
147
|
+
font-family: var(--font-family);
|
|
164
148
|
font-size: var(--font-size-14);
|
|
165
149
|
font-weight: var(--font-weight-regular);
|
|
166
150
|
line-height: var(--lineHeight-14);
|
|
@@ -168,7 +152,7 @@
|
|
|
168
152
|
text-decoration: none;
|
|
169
153
|
}
|
|
170
154
|
.typography--variant-Body2-Medium {
|
|
171
|
-
font-family: var(--font-family
|
|
155
|
+
font-family: var(--font-family);
|
|
172
156
|
font-size: var(--font-size-14);
|
|
173
157
|
font-weight: var(--font-weight-meduim);
|
|
174
158
|
line-height: var(--lineHeight-14);
|
|
@@ -176,7 +160,7 @@
|
|
|
176
160
|
text-decoration: none;
|
|
177
161
|
}
|
|
178
162
|
.typography--variant-Body2-SemiBold{
|
|
179
|
-
font-family: var(--font-family
|
|
163
|
+
font-family: var(--font-family);
|
|
180
164
|
font-size: var(--font-size-14);
|
|
181
165
|
font-weight: var(--font-weight-semiBold);
|
|
182
166
|
line-height: var(--lineHeight-14);
|
|
@@ -184,23 +168,7 @@
|
|
|
184
168
|
text-decoration: none;
|
|
185
169
|
}
|
|
186
170
|
.typography--variant-Body2-Bold{
|
|
187
|
-
font-family: var(--font-family
|
|
188
|
-
font-size: var(--font-size-14);
|
|
189
|
-
font-weight: var(--font-weight-bold);
|
|
190
|
-
line-height: var(--lineHeight-14);
|
|
191
|
-
letter-spacing: var(--letterSpacing);
|
|
192
|
-
text-decoration: none;
|
|
193
|
-
}
|
|
194
|
-
.typography--variant-Body2Mono-Medium {
|
|
195
|
-
font-family: var(--font-family-secondary);
|
|
196
|
-
font-size: var(--font-size-14);
|
|
197
|
-
font-weight: var(--font-weight-medium);
|
|
198
|
-
line-height: var(--lineHeight-14);
|
|
199
|
-
letter-spacing: var(--letterSpacing);
|
|
200
|
-
text-decoration: none;
|
|
201
|
-
}
|
|
202
|
-
.typography--variant-Body2Mono-Bold {
|
|
203
|
-
font-family: var(--font-family-secondary);
|
|
171
|
+
font-family: var(--font-family);
|
|
204
172
|
font-size: var(--font-size-14);
|
|
205
173
|
font-weight: var(--font-weight-bold);
|
|
206
174
|
line-height: var(--lineHeight-14);
|
|
@@ -208,7 +176,7 @@
|
|
|
208
176
|
text-decoration: none;
|
|
209
177
|
}
|
|
210
178
|
.typography--variant-Caption {
|
|
211
|
-
font-family: var(--font-family
|
|
179
|
+
font-family: var(--font-family);
|
|
212
180
|
font-size: var(--font-size-12);
|
|
213
181
|
font-weight: var(--font-weight-regular);
|
|
214
182
|
line-height: var(--lineHeight-12);
|
|
@@ -216,7 +184,7 @@
|
|
|
216
184
|
text-decoration: none;
|
|
217
185
|
}
|
|
218
186
|
.typography--variant-Caption-Medium {
|
|
219
|
-
font-family: var(--font-family
|
|
187
|
+
font-family: var(--font-family);
|
|
220
188
|
font-size: var(--font-size-12);
|
|
221
189
|
font-weight: var(--font-weight-meduim);
|
|
222
190
|
line-height: var(--lineHeight-12);
|
|
@@ -224,36 +192,10 @@
|
|
|
224
192
|
text-decoration: none;
|
|
225
193
|
}
|
|
226
194
|
.typography--variant-Caption-Bold{
|
|
227
|
-
font-family: var(--font-family
|
|
228
|
-
font-size: var(--font-size-12);
|
|
229
|
-
font-weight: var(--font-weight-bold);
|
|
230
|
-
line-height: var(--lineHeight-12);
|
|
231
|
-
letter-spacing: var(--letterSpacing);
|
|
232
|
-
text-decoration: none;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.typography--variant-CaptionMono {
|
|
236
|
-
font-family: var(--font-family-secondary);
|
|
237
|
-
font-size: var(--font-size-12);
|
|
238
|
-
font-weight: var(--font-weight-regular);
|
|
239
|
-
line-height: var(--lineHeight-12);
|
|
240
|
-
letter-spacing: var(--letterSpacing);
|
|
241
|
-
text-decoration: none;
|
|
242
|
-
}
|
|
243
|
-
.typography--variant-CaptionMono-Medium {
|
|
244
|
-
font-family: var(--font-family-secondary);
|
|
245
|
-
font-size: var(--font-size-12);
|
|
246
|
-
font-weight: var(--font-weight-meduim);
|
|
247
|
-
line-height: var(--lineHeight-12);
|
|
248
|
-
letter-spacing: var(--letterSpacing);
|
|
249
|
-
text-decoration: none;
|
|
250
|
-
}
|
|
251
|
-
.typography--variant-CaptionMono-Bold{
|
|
252
|
-
font-family: var(--font-family-secondary);
|
|
195
|
+
font-family: var(--font-family);
|
|
253
196
|
font-size: var(--font-size-12);
|
|
254
197
|
font-weight: var(--font-weight-bold);
|
|
255
198
|
line-height: var(--lineHeight-12);
|
|
256
199
|
letter-spacing: var(--letterSpacing);
|
|
257
200
|
text-decoration: none;
|
|
258
201
|
}
|
|
259
|
-
|
|
@@ -5,14 +5,18 @@ export declare enum ETypographyVariants {
|
|
|
5
5
|
'Heading4' = "Heading4",
|
|
6
6
|
'Subheading1' = "Subheading1",
|
|
7
7
|
'Subheading2' = "Subheading2",
|
|
8
|
+
'Subheading2-Medium' = "Subheading2-Medium",
|
|
8
9
|
'Subheading3' = "Subheading3",
|
|
10
|
+
'Subheading3-Medium' = "Subheading3-Medium",
|
|
9
11
|
'Body' = "Body",
|
|
10
12
|
'Body-Medium' = "Body-Medium",
|
|
11
13
|
'Body-Bold' = "Body-Bold",
|
|
14
|
+
'Body1-Light' = "Body1-Light",
|
|
12
15
|
'Body1' = "Body1",
|
|
13
16
|
'Body1-Medium' = "Body1-Medium",
|
|
14
17
|
'Body1-SemiBold' = "Body1-SemiBold",
|
|
15
18
|
'Body1-Bold' = "Body1-Bold",
|
|
19
|
+
'Body2-Light' = "Body2-Light",
|
|
16
20
|
'Body2' = "Body2",
|
|
17
21
|
'Body2-Medium' = "Body2-Medium",
|
|
18
22
|
'Body2-SemiBold' = "Body2-SemiBold",
|
|
@@ -6,14 +6,18 @@ export var ETypographyVariants;
|
|
|
6
6
|
ETypographyVariants["Heading4"] = "Heading4";
|
|
7
7
|
ETypographyVariants["Subheading1"] = "Subheading1";
|
|
8
8
|
ETypographyVariants["Subheading2"] = "Subheading2";
|
|
9
|
+
ETypographyVariants["Subheading2-Medium"] = "Subheading2-Medium";
|
|
9
10
|
ETypographyVariants["Subheading3"] = "Subheading3";
|
|
11
|
+
ETypographyVariants["Subheading3-Medium"] = "Subheading3-Medium";
|
|
10
12
|
ETypographyVariants["Body"] = "Body";
|
|
11
13
|
ETypographyVariants["Body-Medium"] = "Body-Medium";
|
|
12
14
|
ETypographyVariants["Body-Bold"] = "Body-Bold";
|
|
15
|
+
ETypographyVariants["Body1-Light"] = "Body1-Light";
|
|
13
16
|
ETypographyVariants["Body1"] = "Body1";
|
|
14
17
|
ETypographyVariants["Body1-Medium"] = "Body1-Medium";
|
|
15
18
|
ETypographyVariants["Body1-SemiBold"] = "Body1-SemiBold";
|
|
16
19
|
ETypographyVariants["Body1-Bold"] = "Body1-Bold";
|
|
20
|
+
ETypographyVariants["Body2-Light"] = "Body2-Light";
|
|
17
21
|
ETypographyVariants["Body2"] = "Body2";
|
|
18
22
|
ETypographyVariants["Body2-Medium"] = "Body2-Medium";
|
|
19
23
|
ETypographyVariants["Body2-SemiBold"] = "Body2-SemiBold";
|
package/dist/fonts.css
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
@import url('https://fonts.googleapis.com/css2?family=
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
|
|
2
2
|
:root {
|
|
3
|
-
--font-family
|
|
4
|
-
--font-family-secondary: 'Quicksand', sans-serif;
|
|
3
|
+
--font-family: 'Montserrat', sans-serif;
|
|
5
4
|
|
|
6
5
|
--font-size-48: 48px;
|
|
7
6
|
--font-size-36: 36px;
|
|
@@ -23,6 +22,8 @@
|
|
|
23
22
|
--lineHeight-12: 16px;
|
|
24
23
|
--lineHeight-10: 14px;
|
|
25
24
|
|
|
25
|
+
--font-weight-black: 900;
|
|
26
|
+
--font-weight-extraBold: 800;
|
|
26
27
|
--font-weight-bold: 700;
|
|
27
28
|
--font-weight-semiBold: 600;
|
|
28
29
|
--font-weight-medium:500;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -120,52 +120,60 @@ export type BaseOptions = {
|
|
|
120
120
|
};
|
|
121
121
|
export type TOptions<T = {}> = BaseOptions & T;
|
|
122
122
|
export interface DropdownProps {
|
|
123
|
+
/** Массив элементов для выпадающего списка */
|
|
124
|
+
options: Array<string | number | TOptions>;
|
|
123
125
|
/** Идентификатор */
|
|
124
126
|
id?: string;
|
|
125
|
-
/**
|
|
127
|
+
/** Лейбл */
|
|
126
128
|
label?: string;
|
|
127
129
|
/** Подсказик заполнения */
|
|
128
130
|
placeholder?: string;
|
|
129
|
-
/**
|
|
130
|
-
|
|
131
|
-
/** Массив элементов для выпадающего списка */
|
|
132
|
-
options: Array<string | number | TOptions>;
|
|
133
|
-
/** Функция для получения текста опции */
|
|
134
|
-
getOptionLabel?: (option: TOptions) => keyof TOptions;
|
|
131
|
+
/** Обязательное поле */
|
|
132
|
+
required?: boolean;
|
|
135
133
|
/** Значение */
|
|
136
134
|
value?: string | number | TOptions | null;
|
|
137
135
|
/** Значение по умолчанию */
|
|
138
136
|
defaultValue?: string | number | TOptions | null;
|
|
137
|
+
/** Callback, который будет вызван при изменении значения */
|
|
138
|
+
onChange?: (event: any, value: string | number | TOptions | null) => void;
|
|
139
|
+
/** Функция для получения текста опции */
|
|
140
|
+
getOptionLabel?: (option: TOptions) => keyof TOptions;
|
|
139
141
|
/** Вариaнты выпадающего списка(текст + иконка, текст)' */
|
|
140
142
|
variant?: 'icons' | 'text';
|
|
143
|
+
/** Размер */
|
|
144
|
+
size?: 'md' | 'lg';
|
|
141
145
|
/** Стили передаваемые напрямую */
|
|
142
146
|
style?: CSSProperties;
|
|
143
|
-
|
|
147
|
+
/** Дополнительный класс */
|
|
144
148
|
className?: string;
|
|
149
|
+
/** Отображение левой метки */
|
|
150
|
+
isLeftLabel?: boolean;
|
|
151
|
+
/** Отображение разделителя */
|
|
152
|
+
isDivider?: boolean;
|
|
145
153
|
/** Заблокированный */
|
|
146
154
|
disabled?: boolean;
|
|
147
155
|
/** Только для чтения */
|
|
148
156
|
readOnly?: boolean;
|
|
149
157
|
/** Открытый */
|
|
150
158
|
isOpened?: boolean;
|
|
151
|
-
/** Текст при отсутствии опций */
|
|
152
|
-
noOptionsText?: string;
|
|
153
|
-
/** Отображение левой метки */
|
|
154
|
-
isLeftLabel?: boolean;
|
|
155
159
|
/** Ошибка */
|
|
156
160
|
error?: boolean;
|
|
157
161
|
/** Текст ошибки */
|
|
158
162
|
helperText?: string;
|
|
159
|
-
/** Callback, который будет вызван при
|
|
160
|
-
|
|
163
|
+
/** Callback, который будет вызван при клике */
|
|
164
|
+
onClick?: (event: any) => void;
|
|
165
|
+
/** Callback при потере фокуса */
|
|
166
|
+
onBlur?: (event: any) => void;
|
|
167
|
+
/** Callback при получении фокуса */
|
|
168
|
+
onFocus?: (event: any) => void;
|
|
161
169
|
/** Callback, который будет вызван при закрытии выпадающего списка */
|
|
162
170
|
onClose?: (event: any) => void;
|
|
163
171
|
/** Возможность сброса значения до первоначального */
|
|
164
172
|
clearable?: boolean;
|
|
165
|
-
/**
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
|
|
173
|
+
/** Включение автозаполнения */
|
|
174
|
+
enableAutocomplete?: boolean;
|
|
175
|
+
/** Текст при отсутствии опций */
|
|
176
|
+
noOptionsText?: string;
|
|
169
177
|
}
|
|
170
178
|
/** @internal */
|
|
171
179
|
export interface TypographyProps {
|
|
@@ -237,6 +245,7 @@ export interface TabProps {
|
|
|
237
245
|
value?: string;
|
|
238
246
|
/** Обработчик клика */
|
|
239
247
|
onClick?: (value: string) => void;
|
|
248
|
+
onMouseEnter?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
240
249
|
/** Текст лейбла */
|
|
241
250
|
label?: string;
|
|
242
251
|
/** Размер */
|