kitzo 2.0.21 → 2.0.23

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
@@ -25,7 +25,7 @@ npm i kitzo
25
25
  or
26
26
 
27
27
  ```javascript
28
- <script src="https://cdn.jsdelivr.net/npm/kitzo@2.0.21/dist/kitzo.umd.min.js"></script>
28
+ <script src="https://cdn.jsdelivr.net/npm/kitzo@2.0.23/dist/kitzo.umd.min.js"></script>
29
29
  ```
30
30
 
31
31
  > Attach this script tag in the html head tag and you are good to go.
@@ -117,9 +117,10 @@ document.querySelector('#search').addEventListener('input', (e) => {
117
117
 
118
118
  ```javascript
119
119
  kitzo.clippath(selectors | element | NodeList, {
120
- text: string,
120
+ textOption: null | { selector: string, value: string | number },
121
121
  clippathSize: string | number,
122
122
  smooth: boolean,
123
+ class: string,
123
124
  style: object,
124
125
  });
125
126
  ```
package/dist/kitzo.esm.js CHANGED
@@ -403,6 +403,7 @@ function clippathStyles() {
403
403
  opacity: 0;
404
404
  clip-path: circle(0 at var(--kitzo-clippath-pos-x) var(--kitzo-clippath-pos-y));
405
405
  transition: var(--kitzo-clippath-transition);
406
+ font-family: inherit;
406
407
  }
407
408
  .kitzo-clippath-div.show {
408
409
  opacity: 1;
@@ -499,6 +500,7 @@ function clippath(element, config = {}) {
499
500
  Object.assign(cloned.style, {
500
501
  backgroundColor: '#01c2b8',
501
502
  color: 'white',
503
+ fontFamily: getComputedStyle(btn).fontFamily || 'inherit',
502
504
  ...style,
503
505
  });
504
506
 
@@ -523,10 +525,14 @@ function clippath(element, config = {}) {
523
525
  document.addEventListener('mouseout', (e) => {
524
526
  const btn = e.target.closest('[data-kitzo-clippath]');
525
527
  if (btn) {
528
+ const { smooth } = clippathConfigMap.get(btn);
526
529
  clippathDiv.classList.remove('show');
527
- setTimeout(() => {
528
- clippathDiv.querySelectorAll('[data-temp-clippath-el]').forEach((el) => el.remove());
529
- }, 150);
530
+ setTimeout(
531
+ () => {
532
+ clippathDiv.querySelectorAll('[data-temp-clippath-el]').forEach((el) => el.remove());
533
+ },
534
+ smooth ? 150 : 150
535
+ );
530
536
  }
531
537
  });
532
538
 
package/dist/kitzo.umd.js CHANGED
@@ -409,6 +409,7 @@
409
409
  opacity: 0;
410
410
  clip-path: circle(0 at var(--kitzo-clippath-pos-x) var(--kitzo-clippath-pos-y));
411
411
  transition: var(--kitzo-clippath-transition);
412
+ font-family: inherit;
412
413
  }
413
414
  .kitzo-clippath-div.show {
414
415
  opacity: 1;
@@ -505,6 +506,7 @@
505
506
  Object.assign(cloned.style, {
506
507
  backgroundColor: '#01c2b8',
507
508
  color: 'white',
509
+ fontFamily: getComputedStyle(btn).fontFamily || 'inherit',
508
510
  ...style,
509
511
  });
510
512
 
@@ -529,10 +531,14 @@
529
531
  document.addEventListener('mouseout', (e) => {
530
532
  const btn = e.target.closest('[data-kitzo-clippath]');
531
533
  if (btn) {
534
+ const { smooth } = clippathConfigMap.get(btn);
532
535
  clippathDiv.classList.remove('show');
533
- setTimeout(() => {
534
- clippathDiv.querySelectorAll('[data-temp-clippath-el]').forEach((el) => el.remove());
535
- }, 150);
536
+ setTimeout(
537
+ () => {
538
+ clippathDiv.querySelectorAll('[data-temp-clippath-el]').forEach((el) => el.remove());
539
+ },
540
+ smooth ? 150 : 150
541
+ );
536
542
  }
537
543
  });
538
544
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitzo",
3
- "version": "2.0.21",
3
+ "version": "2.0.23",
4
4
  "description": "A lightweight JavaScript UI micro-library.",
5
5
  "type": "module",
6
6
  "main": "./dist/kitzo.umd.js",