@y14e/tabs 2.0.8 → 2.0.9

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
@@ -13,11 +13,11 @@ npm i @y14e/tabs
13
13
  import Tabs from '@y14e/tabs';
14
14
 
15
15
  // CDNs
16
- import Tabs from 'https://esm.sh/@y14e/tabs@2.0.8';
16
+ import Tabs from 'https://esm.sh/@y14e/tabs@2.0.9';
17
17
  // or
18
- import Tabs from 'https://cdn.jsdelivr.net/npm/@y14e/tabs@2.0.8/+esm';
18
+ import Tabs from 'https://cdn.jsdelivr.net/npm/@y14e/tabs@2.0.9/+esm';
19
19
  // or
20
- import Tabs from 'https://esm.unpkg.com/@y14e/tabs@2.0.8';
20
+ import Tabs from 'https://esm.unpkg.com/@y14e/tabs@2.0.9';
21
21
  ```
22
22
 
23
23
  ## Usage
@@ -1116,13 +1116,13 @@ var TabsIndicator = class {
1116
1116
  if (!tab) {
1117
1117
  return;
1118
1118
  }
1119
- const { x: tabX, y: tabY, width, height } = tab.getBoundingClientRect();
1120
- const { x: listX, y: listY } = this.#listElement.getBoundingClientRect();
1119
+ const tabRect = tab.getBoundingClientRect();
1120
+ const listRect = this.#listElement.getBoundingClientRect();
1121
1121
  const { duration, easing } = this.#settings.animation.indicator;
1122
1122
  this.#animation = this.#rootElement.animate(
1123
1123
  {
1124
- [position]: `${isHorizontal ? tabX - listX : tabY - listY}px`,
1125
- [size]: `${isHorizontal ? width : height}px`
1124
+ [position]: `${isHorizontal ? tabRect.left - listRect.left : tabRect.top - listRect.top}px`,
1125
+ [size]: `${isHorizontal ? tabRect.width : tabRect.height}px`
1126
1126
  },
1127
1127
  { duration, easing, fill: "forwards" }
1128
1128
  );
@@ -1150,7 +1150,7 @@ var TabsIndicator = class {
1150
1150
  * Tabs
1151
1151
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
1152
1152
  *
1153
- * @version 2.0.8
1153
+ * @version 2.0.9
1154
1154
  * @author Yusuke Kamiyamane
1155
1155
  * @license MIT
1156
1156
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -1114,13 +1114,13 @@ var TabsIndicator = class {
1114
1114
  if (!tab) {
1115
1115
  return;
1116
1116
  }
1117
- const { x: tabX, y: tabY, width, height } = tab.getBoundingClientRect();
1118
- const { x: listX, y: listY } = this.#listElement.getBoundingClientRect();
1117
+ const tabRect = tab.getBoundingClientRect();
1118
+ const listRect = this.#listElement.getBoundingClientRect();
1119
1119
  const { duration, easing } = this.#settings.animation.indicator;
1120
1120
  this.#animation = this.#rootElement.animate(
1121
1121
  {
1122
- [position]: `${isHorizontal ? tabX - listX : tabY - listY}px`,
1123
- [size]: `${isHorizontal ? width : height}px`
1122
+ [position]: `${isHorizontal ? tabRect.left - listRect.left : tabRect.top - listRect.top}px`,
1123
+ [size]: `${isHorizontal ? tabRect.width : tabRect.height}px`
1124
1124
  },
1125
1125
  { duration, easing, fill: "forwards" }
1126
1126
  );
@@ -1148,7 +1148,7 @@ var TabsIndicator = class {
1148
1148
  * Tabs
1149
1149
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
1150
1150
  *
1151
- * @version 2.0.8
1151
+ * @version 2.0.9
1152
1152
  * @author Yusuke Kamiyamane
1153
1153
  * @license MIT
1154
1154
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.cjs CHANGED
@@ -493,13 +493,13 @@ var TabsIndicator = class {
493
493
  if (!tab) {
494
494
  return;
495
495
  }
496
- const { x: tabX, y: tabY, width, height } = tab.getBoundingClientRect();
497
- const { x: listX, y: listY } = this.#listElement.getBoundingClientRect();
496
+ const tabRect = tab.getBoundingClientRect();
497
+ const listRect = this.#listElement.getBoundingClientRect();
498
498
  const { duration, easing } = this.#settings.animation.indicator;
499
499
  this.#animation = this.#rootElement.animate(
500
500
  {
501
- [position]: `${isHorizontal ? tabX - listX : tabY - listY}px`,
502
- [size]: `${isHorizontal ? width : height}px`
501
+ [position]: `${isHorizontal ? tabRect.left - listRect.left : tabRect.top - listRect.top}px`,
502
+ [size]: `${isHorizontal ? tabRect.width : tabRect.height}px`
503
503
  },
504
504
  { duration, easing, fill: "forwards" }
505
505
  );
@@ -527,7 +527,7 @@ var TabsIndicator = class {
527
527
  * Tabs
528
528
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
529
529
  *
530
- * @version 2.0.8
530
+ * @version 2.0.9
531
531
  * @author Yusuke Kamiyamane
532
532
  * @license MIT
533
533
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Tabs
3
3
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
4
4
  *
5
- * @version 2.0.8
5
+ * @version 2.0.9
6
6
  * @author Yusuke Kamiyamane
7
7
  * @license MIT
8
8
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Tabs
3
3
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
4
4
  *
5
- * @version 2.0.8
5
+ * @version 2.0.9
6
6
  * @author Yusuke Kamiyamane
7
7
  * @license MIT
8
8
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -487,13 +487,13 @@ var TabsIndicator = class {
487
487
  if (!tab) {
488
488
  return;
489
489
  }
490
- const { x: tabX, y: tabY, width, height } = tab.getBoundingClientRect();
491
- const { x: listX, y: listY } = this.#listElement.getBoundingClientRect();
490
+ const tabRect = tab.getBoundingClientRect();
491
+ const listRect = this.#listElement.getBoundingClientRect();
492
492
  const { duration, easing } = this.#settings.animation.indicator;
493
493
  this.#animation = this.#rootElement.animate(
494
494
  {
495
- [position]: `${isHorizontal ? tabX - listX : tabY - listY}px`,
496
- [size]: `${isHorizontal ? width : height}px`
495
+ [position]: `${isHorizontal ? tabRect.left - listRect.left : tabRect.top - listRect.top}px`,
496
+ [size]: `${isHorizontal ? tabRect.width : tabRect.height}px`
497
497
  },
498
498
  { duration, easing, fill: "forwards" }
499
499
  );
@@ -521,7 +521,7 @@ var TabsIndicator = class {
521
521
  * Tabs
522
522
  * WAI-ARIA compliant tabs pattern implementation in TypeScript.
523
523
  *
524
- * @version 2.0.8
524
+ * @version 2.0.9
525
525
  * @author Yusuke Kamiyamane
526
526
  * @license MIT
527
527
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/tabs",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "description": "WAI-ARIA compliant tabs pattern implementation in TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",