kamotive_ui 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/Icons/IconClose/IconClose10.d.ts +2 -1
  2. package/dist/Icons/IconClose/IconClose10.js +2 -2
  3. package/dist/components/Button/Button.d.ts +1 -1
  4. package/dist/components/Button/Button.js +3 -6
  5. package/dist/components/Button/Button.module.css +0 -11
  6. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  7. package/dist/components/Checkbox/Checkbox.js +5 -3
  8. package/dist/components/Checkbox/Checkbox.module.css +0 -11
  9. package/dist/components/ColorPicker/ColorPicker.d.ts +1 -1
  10. package/dist/components/ColorPicker/ColorPicker.js +12 -11
  11. package/dist/components/ColorPicker/ColorPicker.module.css +25 -42
  12. package/dist/components/Dropdown/Dropdown.d.ts +12 -8
  13. package/dist/components/Dropdown/Dropdown.js +230 -77
  14. package/dist/components/Dropdown/Dropdown.module.css +152 -89
  15. package/dist/components/Input/Input.d.ts +1 -1
  16. package/dist/components/Input/Input.js +26 -25
  17. package/dist/components/Input/Input.module.css +92 -45
  18. package/dist/components/ProgressBar/ProgressBar.d.ts +1 -1
  19. package/dist/components/ProgressBar/ProgressBar.js +4 -3
  20. package/dist/components/ProgressBar/ProgressBar.module.css +4 -11
  21. package/dist/components/ProgressLoader/ProgressLoader.d.ts +1 -1
  22. package/dist/components/ProgressLoader/ProgressLoader.js +3 -2
  23. package/dist/components/ProgressLoader/ProgressLoader.module.css +2 -11
  24. package/dist/components/RadioButton/RadioButton.d.ts +1 -1
  25. package/dist/components/RadioButton/RadioButton.js +5 -3
  26. package/dist/components/RadioButton/RadioButton.module.css +2 -15
  27. package/dist/components/SettingTag/SettingTag.d.ts +1 -1
  28. package/dist/components/SettingTag/SettingTag.js +2 -1
  29. package/dist/components/SettingTag/SettingTag.module.css +0 -9
  30. package/dist/components/Snackbar/Snackbar.d.ts +1 -1
  31. package/dist/components/Snackbar/Snackbar.js +3 -2
  32. package/dist/components/Snackbar/Snackbar.module.css +1 -9
  33. package/dist/components/Tab/Tab.d.ts +1 -1
  34. package/dist/components/Tab/Tab.js +7 -4
  35. package/dist/components/Tab/Tab.module.css +4 -17
  36. package/dist/components/Tabs/Tabs.d.ts +1 -1
  37. package/dist/components/Tabs/Tabs.js +2 -1
  38. package/dist/components/Tabs/Tabs.module.css +0 -6
  39. package/dist/components/Tag/Tag.d.ts +1 -1
  40. package/dist/components/Tag/Tag.js +2 -1
  41. package/dist/components/Tag/Tag.module.css +68 -74
  42. package/dist/components/ToggleButton/ToggleButton.d.ts +1 -1
  43. package/dist/components/ToggleButton/ToggleButton.js +6 -4
  44. package/dist/components/ToggleButton/ToggleButton.module.css +0 -5
  45. package/dist/components/Typography/Typography.d.ts +1 -1
  46. package/dist/components/Typography/Typography.js +3 -2
  47. package/dist/components/Typography/Typography.module.css +8 -13
  48. package/dist/components/Typography/enums.d.ts +2 -0
  49. package/dist/components/Typography/enums.js +2 -0
  50. package/dist/index.d.ts +8 -7
  51. package/dist/index.js +7 -7
  52. package/dist/types/index.d.ts +261 -0
  53. package/dist/types/index.js +1 -0
  54. package/package.json +2 -1
@@ -1,6 +1,7 @@
1
- import { FC } from 'react';
1
+ import React, { FC } from 'react';
2
2
  export declare const IconClose10: FC<{
3
3
  color?: string;
4
4
  htmlColor?: string;
5
5
  strokeWidth?: string;
6
+ onClick?: (event: React.MouseEvent<SVGSVGElement>) => void;
6
7
  }>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export const IconClose10 = ({ color = 'inherit', htmlColor, strokeWidth, }) => {
3
- return (React.createElement("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: color },
2
+ export const IconClose10 = ({ color = 'inherit', htmlColor, strokeWidth, onClick }) => {
3
+ return (React.createElement("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: color, onClick: onClick },
4
4
  React.createElement("path", { fill: htmlColor || 'currentColor', stroke: htmlColor || 'currentColor', strokeWidth: strokeWidth || '0', d: "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" })));
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ButtonProps } from 'kamotive_ui';
2
+ import { ButtonProps } from '../../types';
3
3
  /**
4
4
  * Компонент Button представляет собой кнопку, которую можно настроить с помощью различных параметров (размер, иконки, стили, состояние).
5
5
  */
@@ -1,15 +1,12 @@
1
1
  import React from 'react';
2
2
  import styles from './Button.module.css';
3
3
  import classNames from 'classnames';
4
+ import { Typography } from '../Typography/Typography';
4
5
  /**
5
6
  * Компонент Button представляет собой кнопку, которую можно настроить с помощью различных параметров (размер, иконки, стили, состояние).
6
7
  */
7
8
  export const Button = ({ label, variant = 'fill', size = 'md', style = 'text', condition = 'default', icon, disabled = false, onClick, }) => {
8
- const buttonClasses = classNames(styles['button'], styles[`button--${variant}-${condition}`], styles[`button--${size}`], styles[`button--${style}`]
9
- // {
10
- // ['button--disabled']: disabled,
11
- // }
12
- );
9
+ const buttonClasses = classNames(styles['button'], styles[`button--${variant}-${condition}`], styles[`button--${size}`], styles[`button--${style}`]);
13
10
  const iconColorFn = () => {
14
11
  switch (condition) {
15
12
  case 'default':
@@ -45,5 +42,5 @@ export const Button = ({ label, variant = 'fill', size = 'md', style = 'text', c
45
42
  htmlColor: iconColorStyle,
46
43
  strokeWidth: size === 'lg' ? '0.5' : size === 'md' ? '0.3' : '0.0',
47
44
  }),
48
- label));
45
+ React.createElement(Typography, { variant: 'Body2' }, label)));
49
46
  };
@@ -1,15 +1,4 @@
1
- .story--wrapper-btn {
2
- background-color: var(--white);
3
- padding: 30px;
4
- border-radius: 10px;
5
- width: 900px;
6
- }
7
-
8
1
  .button {
9
- font-family: 'Raleway';
10
- font-style: normal;
11
- font-weight: 400;
12
- line-height: 16.5px;
13
2
  border-radius: 10px;
14
3
  padding: 5px 10px;
15
4
  cursor: pointer;
@@ -1,3 +1,3 @@
1
1
  import { FC } from 'react';
2
- import { CheckboxProps } from 'kamotive_ui';
2
+ import { CheckboxProps } from '../../types';
3
3
  export declare const Checkbox: FC<CheckboxProps>;
@@ -1,13 +1,15 @@
1
1
  import React from 'react';
2
2
  import styles from './Checkbox.module.css';
3
3
  import classNames from 'classnames';
4
+ ;
5
+ import { Typography } from '../Typography/Typography';
4
6
  export const Checkbox = ({ checked, onChange, disabled = false, size = 'sm', label }) => {
5
7
  const handleChange = (e) => {
6
8
  if (onChange) {
7
9
  onChange(e);
8
10
  }
9
11
  };
10
- return (React.createElement("label", { className: styles["checkbox"] },
11
- React.createElement("input", { type: "checkbox", checked: checked, onChange: handleChange, disabled: disabled, className: classNames('input', size) }),
12
- label));
12
+ return (React.createElement("label", { className: styles.checkbox },
13
+ React.createElement("input", { type: "checkbox", checked: checked, onChange: handleChange, disabled: disabled, className: classNames(styles.input, styles[size]) }),
14
+ React.createElement(Typography, { variant: 'Body2' }, label)));
13
15
  };
@@ -1,20 +1,9 @@
1
- .story--wrapper-checkbox {
2
- background-color: var(--white);
3
- padding: 30px;
4
- border-radius: 10px;
5
- }
6
1
 
7
2
  .checkbox {
8
3
  display: flex;
9
4
  align-items: center;
10
5
  justify-content: left;
11
6
  gap: 5px;
12
-
13
- font-family: 'Raleway';
14
- font-style: normal;
15
- font-weight: 400;
16
- font-size: 14px;
17
- line-height: 16px;
18
7
  color: var(--text-dark);
19
8
  }
20
9
 
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { ColorPickerProps } from 'kamotive_ui';
2
+ import { ColorPickerProps } from '../../types';
3
3
  /**
4
4
  * Компонент ColorPicker представляет собой элемент управления для выбора цвета.
5
5
  */
@@ -5,6 +5,7 @@ import { Chrome } from '@uiw/react-color';
5
5
  import EditableInput from '@uiw/react-color-editable-input';
6
6
  import { GithubPlacement } from '@uiw/react-color-github';
7
7
  import { IconColorPicker10 } from '../../Icons';
8
+ ;
8
9
  /**
9
10
  * Компонент ColorPicker представляет собой элемент управления для выбора цвета.
10
11
  */
@@ -50,14 +51,14 @@ export const ColorPicker = ({ color = '#ffffff', mainColor, recentColors, setIsH
50
51
  !autoOpen && document.removeEventListener('mousedown', handleClickOutside);
51
52
  };
52
53
  }, [isOpen]);
53
- const mainColorClasses = classNames(styles['circle'], {
54
- 'mainColor': mainColor,
54
+ const mainColorClasses = classNames(styles.circle, {
55
+ [styles['mainColor']]: mainColor,
55
56
  });
56
- const colorCircleDefaultClasses = classNames(styles['circle'], {
57
- 'colorCircleDefault': color === '#ffffff' && !isColorChanged || isColorChanged && selectedColor !== colorValue
57
+ const colorCircleDefaultClasses = classNames(styles.circle, {
58
+ [styles.colorCircleDefault]: color === '#ffffff' && !isColorChanged || isColorChanged && selectedColor !== colorValue
58
59
  });
59
60
  const popoverClassess = classNames(styles['popover'], {
60
- [`popover--${popoverPosition}`]: true,
61
+ [styles[`popover--${popoverPosition}`]]: true,
61
62
  });
62
63
  // Функция для преобразования HEXA в HEX
63
64
  const hexaToHex = (hexa = 'fff') => {
@@ -86,27 +87,27 @@ export const ColorPicker = ({ color = '#ffffff', mainColor, recentColors, setIsH
86
87
  useEffect(() => {
87
88
  setSelectedColor(color);
88
89
  }, [color]);
89
- return (React.createElement("div", { className: (mainColor || recentColors) ? 'colorPickerWrapper' : '', onMouseLeave: () => setIsHovered && setIsHovered(false) },
90
+ return (React.createElement("div", { className: (mainColor || recentColors) && styles.colorPickerWrapper, onMouseLeave: () => setIsHovered && setIsHovered(false) },
90
91
  mainColor && React.createElement("div", { className: mainColorClasses, style: {
91
92
  width: `${width}px`,
92
93
  height: `${height}px`,
93
94
  backgroundColor: (colorValue === null || colorValue === void 0 ? void 0 : colorValue.startsWith('#')) ? colorValue : `var(--${colorValue})`,
94
95
  }, onClick: () => setIsHovered && setIsHovered(false) }),
95
- recentColors && recentColors.map((color, index) => (React.createElement("div", { key: index, className: "circle", style: {
96
+ recentColors && recentColors.map((color, index) => (React.createElement("div", { key: index, className: styles.circle, style: {
96
97
  width: `${width}px`,
97
98
  height: `${height}px`,
98
99
  backgroundColor: color.startsWith('#') ? color : `var(--${color})`,
99
100
  }, onClick: () => colorChangeHandler(color) }))),
100
- React.createElement("div", { className: "colorPicker" },
101
+ React.createElement("div", { className: styles.colorPicker },
101
102
  React.createElement("div", { ref: circleRef, className: colorCircleDefaultClasses, onClick: () => setIsOpen(!isOpen), style: {
102
103
  width: `${width}px`,
103
104
  height: `${height}px`,
104
105
  backgroundColor: selectedColor.startsWith('#') ? selectedColor : `var(--${selectedColor})`,
105
106
  } }),
106
107
  isOpen && (React.createElement("div", { ref: popoverRef, className: popoverClassess },
107
- isOpen && React.createElement(IconColorPicker10, { className: "colorPickerIcon", htmlColor: 'var(--white)' }),
108
- React.createElement(Chrome, { color: selectedColor, placement: GithubPlacement.Right, onChange: colorChangeHandler, className: "customChrome", showEyeDropper: false }),
109
- React.createElement("div", { className: "hex", style: { padding: '0 10px 0 20px' } },
108
+ isOpen && React.createElement(IconColorPicker10, { className: styles.colorPickerIcon, htmlColor: 'var(--white)' }),
109
+ React.createElement(Chrome, { color: selectedColor, placement: GithubPlacement.Right, onChange: colorChangeHandler, className: styles.customChrome, showEyeDropper: false }),
110
+ React.createElement("div", { className: styles.hex, style: { padding: '0 10px 0 20px' } },
110
111
  React.createElement(EditableInput, { value: hexaToHex(selectedColor), style: { width: 68, alignItems: 'flex-start' }, onChange: (e, color) => {
111
112
  const formattedColor = hexaToHex(color.toString());
112
113
  colorChangeHandler(formattedColor);
@@ -1,9 +1,3 @@
1
- .story--wrapper-colorpicker {
2
- background-color: var(--white);
3
- padding: 30px;
4
- border-radius: 10px;
5
- width: 900px;
6
- }
7
1
 
8
2
  .colorPicker {
9
3
  -webkit-appearance: none;
@@ -13,11 +7,6 @@
13
7
  position: relative;
14
8
  cursor: pointer;
15
9
  padding: 0;
16
- font-family: 'Raleway';
17
- font-style: normal;
18
- font-weight: 400;
19
- line-height: 16.5px;
20
- font-size: 16px;
21
10
  }
22
11
 
23
12
  .colorPicker:hover{
@@ -25,13 +14,8 @@
25
14
  background-color: var(--white);
26
15
  border-radius: 50%;
27
16
  padding: 0;
28
- font-family: 'Raleway';
29
- font-style: normal;
30
- font-weight: 400;
31
- line-height: 16.5px;
32
- font-size: 16px;
33
-
34
17
  }
18
+
35
19
  .colorPicker--defaultColor{
36
20
  background: conic-gradient(
37
21
  rgba(255, 59, 48) 0deg,
@@ -143,7 +127,7 @@
143
127
  z-index: 100;
144
128
  }
145
129
 
146
- .w-color-swatch{
130
+ :global(.w-color-swatch){
147
131
  padding: 10px !important;
148
132
  border-radius: 10px !important;
149
133
  width: fit-content !important;
@@ -154,73 +138,72 @@
154
138
  --github-border: 0px !important;
155
139
  }
156
140
 
157
- .w-color-swatch > div:nth-child(1),
158
- .w-color-swatch > div:nth-child(2){
141
+ :global(.w-color-swatch) > div:nth-child(1),
142
+ :global(.w-color-swatch) > div:nth-child(2){
159
143
  display: none !important;
160
144
  }
161
- .w-color-swatch > div:nth-child(3) {
145
+ :global(.w-color-swatch) > div:nth-child(3) {
162
146
  width: 195px !important;
163
147
  height: 195px !important;
164
148
  border-radius: 10px !important;
165
149
  }
166
150
 
167
- .w-color-swatch > div:nth-child(4){
151
+ :global(.w-color-swatch) > div:nth-child(4){
168
152
  gap: 15px !important;
169
153
  padding: 10px 0 !important;
170
154
  /* width: 80%; */
171
155
  }
172
- .w-color-swatch > div:nth-child(5){
156
+ :global(.w-color-swatch) > div:nth-child(5){
173
157
  padding: 0 !important;
174
158
 
175
159
  }
176
- .w-color-swatch > div:nth-child(5) > div:nth-child(2){
160
+ :global(.w-color-swatch) > div:nth-child(5) > div:nth-child(2){
177
161
  display: none !important;
178
162
  /* width: 80%; */
179
163
  }
180
164
  /* Для всех инпутов в пикере */
181
- .w-color-chrome .w-color-editable-input input {
165
+ :global(.w-color-chrome) :global(.w-color-editable-input) input {
182
166
  font-family: 'Raleway' !important;
183
167
  font-style: normal !important;
184
168
  font-weight: 400 !important;
185
169
  line-height: 14px !important;
186
170
  font-size: 12px !important;
187
171
  margin: 0 !important;
188
- }
189
- .w-color-editable-input{
172
+ }
173
+ :global(.w-color-editable-input){
190
174
  margin: 0 !important;
191
175
  max-width: 30px !important;
192
176
  flex-direction: column-reverse !important;
193
177
  --editable-input-box-shadow : none !important;
194
178
  }
195
- .w-color-editable-input-rgba{
179
+ :global(.w-color-editable-input-rgba){
196
180
  justify-content: end !important;
197
181
  }
198
182
 
199
- .w-color-editable-input > span {
183
+ :global(.w-color-editable-input) > span {
200
184
  padding-top: 0 !important;
201
185
  }
202
- .w-color-editable-input:nth-child(1)> input{
186
+ :global(.w-color-editable-input:nth-child(1))> input{
203
187
  border-radius: 10px 0 0 10px !important;
204
- border: 1px solid var(--grey-light) !important;
188
+ border: 1px solid var(--grey-light) !important;
205
189
  }
206
- .w-color-editable-input:nth-child(2)> input{
190
+ :global(.w-color-editable-input:nth-child(2))> input{
207
191
  border-radius: 0 0 0 0px !important;
208
192
  border: 1px solid var(--grey-light) !important;
209
193
  border-left: none !important;
210
194
  }
211
- .w-color-editable-input:nth-child(3)> input{
195
+ :global(.w-color-editable-input:nth-child(3))> input{
212
196
  border-radius: 0 0 0 0px !important;
213
-
214
197
  border: 1px solid var(--grey-light) !important;
215
198
  border-left: none !important;
216
199
  }
217
- .w-color-editable-input:nth-child(4)> input{
200
+ :global(.w-color-editable-input:nth-child(4))> input{
218
201
  border-radius: 0px 10px 10px 0px !important;
219
202
  border: 1px solid var(--grey-light) !important;
220
203
  border-left: none !important;
221
204
  }
222
205
  /* Для лейблов */
223
- .w-color-chrome-fields.w-color-editable-input label {
206
+ :global(.w-color-chrome-fields) :global(.w-color-editable-input) label {
224
207
  font-family: 'Raleway' !important;
225
208
  font-style: normal !important;
226
209
  font-weight: 400 !important;
@@ -228,19 +211,19 @@ border-left: none !important;
228
211
  font-size: 16px !important;
229
212
  }
230
213
 
231
- .w-color-alpha-horizontal > div.w-color-interactive{
214
+ :global(.w-color-alpha-horizontal > div.w-color-interactive){
232
215
  border-radius: 8px !important;
233
216
  }
234
- .w-color-alpha-horizontal:first-of-type > div:first-child{
217
+ :global(.w-color-alpha-horizontal:first-of-type > div:first-child){
235
218
  border-radius: 50px !important;
236
219
  }
237
- .w-color-alpha-horizontal:nth-of-type(2) > div:first-child{
220
+ :global(.w-color-alpha-horizontal:nth-of-type(2) > div:first-child){
238
221
  border-radius: 50px !important;
239
222
  }
240
223
 
241
224
  .colorPickerIcon {
242
225
  position: absolute;
243
- top: 68%;
226
+ top: 69%;
244
227
  left: 8px;
245
228
  z-index: 200;
246
229
  padding: 10px;
@@ -251,10 +234,10 @@ border-left: none !important;
251
234
  bottom: 20px;
252
235
  left: -10px;
253
236
  }
254
- .hex .w-color-editable-input{
237
+ .hex :global(.w-color-editable-input){
255
238
  border-radius: 10px !important;
256
239
  }
257
- .hex > .w-color-editable-input > input {
240
+ .hex > :global(.w-color-editable-input) > input {
258
241
  /* padding: 0 !important; */
259
242
  font-size: 12px !important;
260
243
  font-family: 'Raleway' !important;
@@ -1,14 +1,18 @@
1
- import { FC } from 'react';
2
- import { DropdownProps } from 'kamotive_ui';
1
+ import React, { FC } from 'react';
2
+ import { DropdownProps, TOptions } from '../../types';
3
3
  /**
4
4
  * Компонент Dropdown позволяет пользователям выбирать однин вариант из выпадающего меню
5
- */
5
+ */
6
6
  export interface DropdownListItemProps {
7
- item: DropdownProps['items'][number];
8
- size: 'sm' | 'md' | 'lg';
9
- selectedItem: DropdownProps['items'][number] | null | string | number;
10
- style?: 'default' | 'text';
11
- onChange: (value: DropdownProps['items'][number]) => void;
7
+ item: TOptions | null;
8
+ getOptionLabel?: ((option: TOptions) => string);
9
+ size: 'md' | 'lg';
10
+ selectedItem: TOptions | null;
11
+ style?: 'icons' | 'text';
12
+ onChange: (event: React.MouseEvent<HTMLElement>, item: TOptions | null) => void;
13
+ isActive?: boolean;
14
+ activeIndex?: number;
15
+ index?: number;
12
16
  }
13
17
  export declare const DropdownListItem: FC<DropdownListItemProps>;
14
18
  export declare const Dropdown: FC<DropdownProps>;