@zag-js/tabs 0.0.0-dev-20220709094318 → 0.0.0-dev-20220709145914

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
@@ -86,7 +86,7 @@ function getDocument(el) {
86
86
  return el;
87
87
  return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
88
88
  }
89
- function withRootHelpers(domUtils) {
89
+ function defineDomHelpers(domUtils) {
90
90
  const roots = {
91
91
  getRootNode: (ctx) => {
92
92
  var _a, _b;
@@ -96,7 +96,8 @@ function withRootHelpers(domUtils) {
96
96
  getWin: (ctx) => {
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
101
  };
101
102
  return __spreadValues2(__spreadValues2({}, roots), domUtils);
102
103
  }
@@ -205,7 +206,7 @@ var first = (v) => v[0];
205
206
  var last = (v) => v[v.length - 1];
206
207
 
207
208
  // src/tabs.dom.ts
208
- var dom = withRootHelpers({
209
+ var dom = defineDomHelpers({
209
210
  getRootId: (ctx) => {
210
211
  var _a, _b;
211
212
  return (_b = (_a = ctx.ids) == null ? void 0 : _a.root) != null ? _b : `tabs:${ctx.id}`;
package/dist/index.mjs CHANGED
@@ -62,7 +62,7 @@ function getDocument(el) {
62
62
  return el;
63
63
  return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document;
64
64
  }
65
- function withRootHelpers(domUtils) {
65
+ function defineDomHelpers(domUtils) {
66
66
  const roots = {
67
67
  getRootNode: (ctx) => {
68
68
  var _a, _b;
@@ -72,7 +72,8 @@ function withRootHelpers(domUtils) {
72
72
  getWin: (ctx) => {
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
77
  };
77
78
  return __spreadValues2(__spreadValues2({}, roots), domUtils);
78
79
  }
@@ -181,7 +182,7 @@ var first = (v) => v[0];
181
182
  var last = (v) => v[v.length - 1];
182
183
 
183
184
  // src/tabs.dom.ts
184
- var dom = withRootHelpers({
185
+ var dom = defineDomHelpers({
185
186
  getRootId: (ctx) => {
186
187
  var _a, _b;
187
188
  return (_b = (_a = ctx.ids) == null ? void 0 : _a.root) != null ? _b : `tabs:${ctx.id}`;
@@ -9,6 +9,9 @@ export declare const dom: {
9
9
  getWin: (ctx: {
10
10
  getRootNode?: () => Node | Document | ShadowRoot;
11
11
  }) => Window & typeof globalThis;
12
+ getActiveElement: (ctx: {
13
+ getRootNode?: () => Node | Document | ShadowRoot;
14
+ }) => HTMLElement;
12
15
  } & {
13
16
  getRootId: (ctx: Ctx) => string;
14
17
  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-20220709094318",
3
+ "version": "0.0.0-dev-20220709145914",
4
4
  "description": "Core logic for the tabs widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -30,8 +30,8 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@zag-js/core": "0.1.7",
33
- "@zag-js/dom-utils": "0.0.0-dev-20220709094318",
34
- "@zag-js/types": "0.0.0-dev-20220709094318",
33
+ "@zag-js/dom-utils": "0.0.0-dev-20220709145914",
34
+ "@zag-js/types": "0.0.0-dev-20220709145914",
35
35
  "@zag-js/utils": "0.1.2"
36
36
  },
37
37
  "scripts": {