kitzo 1.1.0 → 1.1.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 +5 -7
- package/dist/kitzo.d.ts +51 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ npm i kitzo
|
|
|
21
21
|
or
|
|
22
22
|
|
|
23
23
|
```javascript
|
|
24
|
-
<script src="https://cdn.jsdelivr.net/npm/kitzo@1.1.
|
|
24
|
+
<script src="https://cdn.jsdelivr.net/npm/kitzo@1.1.2/dist/kitzo.umd.min.js"></script>
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
> Attach this script tag in the html head tag and you are good to go.
|
|
@@ -30,10 +30,6 @@ or
|
|
|
30
30
|
|
|
31
31
|
#### Quick usage overview
|
|
32
32
|
|
|
33
|
-
```javascript
|
|
34
|
-
// NPM usage
|
|
35
|
-
import kitzo from 'kitzo';
|
|
36
|
-
```
|
|
37
33
|
|
|
38
34
|
| [API](#apis) |
|
|
39
35
|
| ----------------------------------- |
|
|
@@ -41,11 +37,13 @@ import kitzo from 'kitzo';
|
|
|
41
37
|
| [`kitzo.tooltip()`](#tooltip-api) |
|
|
42
38
|
| [`kitzo.ripple()`](#ripple-api) |
|
|
43
39
|
| [`kitzo.debounce()`](#debounce-api) |
|
|
44
|
-
| [`kitzo.clippath()`](#clippath-api)
|
|
40
|
+
| [`kitzo.clippath()`](#clippath-api) |
|
|
45
41
|
|
|
46
42
|
#### APIs
|
|
47
|
-
|
|
48
43
|
```javascript
|
|
44
|
+
// NPM usage
|
|
45
|
+
import kitzo from 'kitzo';
|
|
46
|
+
|
|
49
47
|
kitzo.copy();
|
|
50
48
|
kitzo.tooltip();
|
|
51
49
|
kitzo.ripple();
|
package/dist/kitzo.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// Tooltip
|
|
2
|
+
export type tooltip = (
|
|
2
3
|
element: string | Element | NodeListOf<Element>,
|
|
3
4
|
config?: {
|
|
4
5
|
/**
|
|
@@ -27,64 +28,77 @@ export function tooltip(
|
|
|
27
28
|
customClass?: string;
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
|
-
* Inline styles to apply (excluding
|
|
31
|
+
* Inline styles to apply (excluding positioning/z-index/transform stuff)
|
|
31
32
|
*/
|
|
32
33
|
style?: Partial<CSSStyleDeclaration>;
|
|
33
34
|
}
|
|
34
|
-
)
|
|
35
|
+
) => void;
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
// Ripple
|
|
38
|
+
export type ripple = (
|
|
37
39
|
element: string | Element | NodeListOf<Element>,
|
|
38
40
|
config?: {
|
|
39
|
-
/**
|
|
40
|
-
* Ripple opacity (0 to 1). Default: 0.5
|
|
41
|
-
*/
|
|
41
|
+
/** Ripple opacity (0 to 1). Default: 0.5 */
|
|
42
42
|
opacity?: number;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
*/
|
|
43
|
+
|
|
44
|
+
/** Animation duration in seconds. Default: 1 */
|
|
46
45
|
duration?: number;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
*/
|
|
46
|
+
|
|
47
|
+
/** Ripple color (CSS color). Default: 'white' */
|
|
50
48
|
color?: string;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*/
|
|
49
|
+
|
|
50
|
+
/** Ripple size in pixels. If null, auto-scales. Default: null */
|
|
54
51
|
size?: number | null;
|
|
55
52
|
}
|
|
56
|
-
)
|
|
53
|
+
) => void;
|
|
57
54
|
|
|
58
|
-
|
|
55
|
+
// Copy
|
|
56
|
+
export type copy = (
|
|
59
57
|
element: string | Element | NodeListOf<Element>,
|
|
60
|
-
config
|
|
61
|
-
/**
|
|
62
|
-
* The text to be copied to the clipboard.
|
|
63
|
-
* Must be a non-empty string.
|
|
64
|
-
*/
|
|
58
|
+
config?: {
|
|
59
|
+
/** The text to copy to clipboard (default: element textContent) */
|
|
65
60
|
doc?: string;
|
|
66
61
|
|
|
67
62
|
/**
|
|
68
|
-
* The DOM event that triggers the copy action
|
|
69
|
-
* Only
|
|
70
|
-
*
|
|
71
|
-
* - 'dblclick'
|
|
72
|
-
* - 'contextmenu'
|
|
73
|
-
* - 'mouseup'
|
|
74
|
-
* - 'touchend'
|
|
63
|
+
* The DOM event that triggers the copy action
|
|
64
|
+
* Only allowed: 'click' | 'dblclick' | 'contextmenu' | 'mouseup' | 'touchend'
|
|
65
|
+
* Default: 'click'
|
|
75
66
|
*/
|
|
76
67
|
event?: 'click' | 'dblclick' | 'contextmenu' | 'mouseup' | 'touchend';
|
|
77
68
|
}
|
|
78
|
-
)
|
|
69
|
+
) => void;
|
|
79
70
|
|
|
80
|
-
|
|
71
|
+
// Debounce
|
|
72
|
+
export type debounce = <Args extends any[]>(
|
|
73
|
+
fn: (...args: Args) => any,
|
|
74
|
+
delay?: number
|
|
75
|
+
) => (...args: Args) => void;
|
|
81
76
|
|
|
82
|
-
|
|
77
|
+
// Clippath
|
|
78
|
+
export type clippath = (
|
|
83
79
|
element: string | Element | NodeListOf<Element>,
|
|
84
80
|
config?: {
|
|
85
|
-
text
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
/** Optional text inside the clippath element */
|
|
82
|
+
text?: string;
|
|
83
|
+
|
|
84
|
+
/** Size of the clippath circle (px or %). Default: '20%' */
|
|
85
|
+
clippathSize?: string | number;
|
|
86
|
+
|
|
87
|
+
/** Enable smooth transition (default: true) */
|
|
88
|
+
smooth?: boolean;
|
|
89
|
+
|
|
90
|
+
/** Custom inline styles */
|
|
88
91
|
style?: Partial<CSSStyleDeclaration>;
|
|
89
92
|
}
|
|
90
|
-
)
|
|
93
|
+
) => void;
|
|
94
|
+
|
|
95
|
+
// Kitzo Bundle
|
|
96
|
+
export interface Kitzo {
|
|
97
|
+
tooltip: tooltip;
|
|
98
|
+
ripple: ripple;
|
|
99
|
+
copy: copy;
|
|
100
|
+
debounce: debounce;
|
|
101
|
+
clippath: clippath;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export const kitzo: Kitzo;
|