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 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.0/dist/kitzo.umd.min.js"></script>
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
- export function tooltip(
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 top, left, right, bottom, position, zIndex, opacity, transform, translate, scale, rotate, perspective)
31
+ * Inline styles to apply (excluding positioning/z-index/transform stuff)
31
32
  */
32
33
  style?: Partial<CSSStyleDeclaration>;
33
34
  }
34
- ): void;
35
+ ) => void;
35
36
 
36
- export function ripple(
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
- * Animation duration in seconds ('s'). Default: 1
45
- */
43
+
44
+ /** Animation duration in seconds. Default: 1 */
46
45
  duration?: number;
47
- /**
48
- * Ripple color (CSS color). Default: 'white'
49
- */
46
+
47
+ /** Ripple color (CSS color). Default: 'white' */
50
48
  color?: string;
51
- /**
52
- * Ripple size in pixels ('px'). If null, auto-scales based on button size. Default: null
53
- */
49
+
50
+ /** Ripple size in pixels. If null, auto-scales. Default: null */
54
51
  size?: number | null;
55
52
  }
56
- ): void;
53
+ ) => void;
57
54
 
58
- export function copy(
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 the following events are allowed:
70
- * - 'click' (default)
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
- ): void;
69
+ ) => void;
79
70
 
80
- export function debounce<Args extends any[]>(fn: (...args: Args) => any, delay?: number): (...args: Args) => void;
71
+ // Debounce
72
+ export type debounce = <Args extends any[]>(
73
+ fn: (...args: Args) => any,
74
+ delay?: number
75
+ ) => (...args: Args) => void;
81
76
 
82
- export function clippath(
77
+ // Clippath
78
+ export type clippath = (
83
79
  element: string | Element | NodeListOf<Element>,
84
80
  config?: {
85
- text?: String;
86
- clippathSize?: String | Number;
87
- smooth?: Boolean;
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
- ): void;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitzo",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "A lightweight JavaScript UI micro-library.",
5
5
  "type": "module",
6
6
  "main": "./dist/kitzo.umd.js",