@zag-js/tabs 0.0.0-dev-20220709173135 → 0.0.0-dev-20220710102425

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/index.js CHANGED
@@ -97,7 +97,8 @@ function defineDomHelpers(domUtils) {
97
97
  var _a;
98
98
  return (_a = roots.getDoc(ctx).defaultView) != null ? _a : window;
99
99
  },
100
- getActiveElement: (ctx) => roots.getDoc(ctx).activeElement
100
+ getActiveElement: (ctx) => roots.getDoc(ctx).activeElement,
101
+ getById: (ctx, id) => roots.getRootNode(ctx).getElementById(id)
101
102
  };
102
103
  return __spreadValues2(__spreadValues2({}, roots), domUtils);
103
104
  }
@@ -573,9 +574,7 @@ function machine(ctx) {
573
574
  });
574
575
  },
575
576
  checkRenderedElements(ctx2) {
576
- nextTick(() => {
577
- ctx2.isIndicatorRendered = !!dom.getIndicatorEl(ctx2);
578
- });
577
+ ctx2.isIndicatorRendered = !!dom.getIndicatorEl(ctx2);
579
578
  },
580
579
  clearMeasured(ctx2) {
581
580
  ctx2.hasMeasuredRect = false;
package/dist/index.mjs CHANGED
@@ -73,7 +73,8 @@ function defineDomHelpers(domUtils) {
73
73
  var _a;
74
74
  return (_a = roots.getDoc(ctx).defaultView) != null ? _a : window;
75
75
  },
76
- getActiveElement: (ctx) => roots.getDoc(ctx).activeElement
76
+ getActiveElement: (ctx) => roots.getDoc(ctx).activeElement,
77
+ getById: (ctx, id) => roots.getRootNode(ctx).getElementById(id)
77
78
  };
78
79
  return __spreadValues2(__spreadValues2({}, roots), domUtils);
79
80
  }
@@ -549,9 +550,7 @@ function machine(ctx) {
549
550
  });
550
551
  },
551
552
  checkRenderedElements(ctx2) {
552
- nextTick(() => {
553
- ctx2.isIndicatorRendered = !!dom.getIndicatorEl(ctx2);
554
- });
553
+ ctx2.isIndicatorRendered = !!dom.getIndicatorEl(ctx2);
555
554
  },
556
555
  clearMeasured(ctx2) {
557
556
  ctx2.hasMeasuredRect = false;
@@ -12,6 +12,9 @@ export declare const dom: {
12
12
  getActiveElement: (ctx: {
13
13
  getRootNode?: () => Node | Document | ShadowRoot;
14
14
  }) => HTMLElement;
15
+ getById: (ctx: {
16
+ getRootNode?: () => Node | Document | ShadowRoot;
17
+ }, id: string) => HTMLElement;
15
18
  } & {
16
19
  getRootId: (ctx: Ctx) => string;
17
20
  getTriggerGroupId: (ctx: Ctx) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/tabs",
3
- "version": "0.0.0-dev-20220709173135",
3
+ "version": "0.0.0-dev-20220710102425",
4
4
  "description": "Core logic for the tabs widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -30,8 +30,10 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@zag-js/core": "0.1.7",
33
- "@zag-js/dom-utils": "0.0.0-dev-20220709173135",
34
- "@zag-js/types": "0.0.0-dev-20220709173135",
33
+ "@zag-js/types": "0.0.0-dev-20220710102425"
34
+ },
35
+ "devDependencies": {
36
+ "@zag-js/dom-utils": "0.0.0-dev-20220710102425",
35
37
  "@zag-js/utils": "0.1.2"
36
38
  },
37
39
  "scripts": {