kwant-ui 3.41.0-dev.0 → 3.41.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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kwant-ui",
3
- "version": "3.41.0-dev.0",
3
+ "version": "3.41.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",
@@ -112,6 +112,11 @@ const colors: Color = {
112
112
  warningLower: '#FED7AA',
113
113
  warningLower2: '#FFEDD5',
114
114
  },
115
+ alert: {
116
+ border: '#FAEC88',
117
+ background: '#FCF9DC',
118
+ icon: '#EAB308',
119
+ },
115
120
 
116
121
  disabled: {
117
122
  disabledHigh: '#B1B1B1',
@@ -9,4 +9,5 @@ export declare const stringToColor: (str: string) => string;
9
9
  declare const isArray: (array: unknown) => boolean;
10
10
  declare const isArrayEmpty: <T>(array: T[]) => boolean;
11
11
  declare const getLastItem: <T>(array: T[]) => T;
12
- export { switchValue, escapeRegExp, mobileView, tabletView, overflowView, isArray, isArrayEmpty, getLastItem, };
12
+ declare function debounce<T extends (...args: any[]) => void>(func: T, delay: number): (...args: Parameters<T>) => void;
13
+ export { switchValue, escapeRegExp, mobileView, tabletView, overflowView, isArray, isArrayEmpty, getLastItem, debounce, };
@@ -74,6 +74,19 @@ export const stringToColor = function (str: string) {
74
74
  const isArray = (array: unknown) => Array.isArray(array);
75
75
  const isArrayEmpty = <T>(array: Array<T>) => array.length === 0;
76
76
  const getLastItem = <T>(array: Array<T>) => array[array.length - 1];
77
+
78
+ function debounce<T extends (...args: any[]) => void>(func: T, delay: number) {
79
+ let timeoutId: NodeJS.Timeout;
80
+
81
+ return (...args: Parameters<T>) => {
82
+ clearTimeout(timeoutId);
83
+
84
+ timeoutId = setTimeout(() => {
85
+ func(...args);
86
+ }, delay);
87
+ };
88
+ }
89
+
77
90
  export {
78
91
  switchValue,
79
92
  escapeRegExp,
@@ -83,4 +96,5 @@ export {
83
96
  isArray,
84
97
  isArrayEmpty,
85
98
  getLastItem,
99
+ debounce,
86
100
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kwant-ui",
3
- "version": "3.41.0-dev.0",
3
+ "version": "3.41.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",
package/themes/colors.ts CHANGED
@@ -112,6 +112,11 @@ const colors: Color = {
112
112
  warningLower: '#FED7AA',
113
113
  warningLower2: '#FFEDD5',
114
114
  },
115
+ alert: {
116
+ border: '#FAEC88',
117
+ background: '#FCF9DC',
118
+ icon: '#EAB308',
119
+ },
115
120
 
116
121
  disabled: {
117
122
  disabledHigh: '#B1B1B1',
package/utils/index.ts CHANGED
@@ -74,6 +74,19 @@ export const stringToColor = function (str: string) {
74
74
  const isArray = (array: unknown) => Array.isArray(array);
75
75
  const isArrayEmpty = <T>(array: Array<T>) => array.length === 0;
76
76
  const getLastItem = <T>(array: Array<T>) => array[array.length - 1];
77
+
78
+ function debounce<T extends (...args: any[]) => void>(func: T, delay: number) {
79
+ let timeoutId: NodeJS.Timeout;
80
+
81
+ return (...args: Parameters<T>) => {
82
+ clearTimeout(timeoutId);
83
+
84
+ timeoutId = setTimeout(() => {
85
+ func(...args);
86
+ }, delay);
87
+ };
88
+ }
89
+
77
90
  export {
78
91
  switchValue,
79
92
  escapeRegExp,
@@ -83,4 +96,5 @@ export {
83
96
  isArray,
84
97
  isArrayEmpty,
85
98
  getLastItem,
99
+ debounce,
86
100
  };