@zag-js/tabs 1.11.0 → 1.12.1
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.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -12,8 +12,9 @@ interface FocusChangeDetails {
|
|
|
12
12
|
focusedValue: string;
|
|
13
13
|
}
|
|
14
14
|
interface NavigateDetails {
|
|
15
|
-
value: string
|
|
15
|
+
value: string;
|
|
16
16
|
node: HTMLAnchorElement;
|
|
17
|
+
href: string;
|
|
17
18
|
}
|
|
18
19
|
interface IntlTranslations {
|
|
19
20
|
listLabel?: string | undefined;
|
|
@@ -84,7 +85,7 @@ interface TabsProps extends DirectionProperty, CommonProperties {
|
|
|
84
85
|
* Function to navigate to the selected tab when clicking on it.
|
|
85
86
|
* Useful if tab triggers are anchor elements.
|
|
86
87
|
*/
|
|
87
|
-
navigate?: ((details: NavigateDetails) => void) | undefined;
|
|
88
|
+
navigate?: ((details: NavigateDetails) => void) | null | undefined;
|
|
88
89
|
}
|
|
89
90
|
type PropsWithDefault = "orientation" | "activationMode" | "loopFocus";
|
|
90
91
|
type TabsSchema = {
|
package/dist/index.d.ts
CHANGED
|
@@ -12,8 +12,9 @@ interface FocusChangeDetails {
|
|
|
12
12
|
focusedValue: string;
|
|
13
13
|
}
|
|
14
14
|
interface NavigateDetails {
|
|
15
|
-
value: string
|
|
15
|
+
value: string;
|
|
16
16
|
node: HTMLAnchorElement;
|
|
17
|
+
href: string;
|
|
17
18
|
}
|
|
18
19
|
interface IntlTranslations {
|
|
19
20
|
listLabel?: string | undefined;
|
|
@@ -84,7 +85,7 @@ interface TabsProps extends DirectionProperty, CommonProperties {
|
|
|
84
85
|
* Function to navigate to the selected tab when clicking on it.
|
|
85
86
|
* Useful if tab triggers are anchor elements.
|
|
86
87
|
*/
|
|
87
|
-
navigate?: ((details: NavigateDetails) => void) | undefined;
|
|
88
|
+
navigate?: ((details: NavigateDetails) => void) | null | undefined;
|
|
88
89
|
}
|
|
89
90
|
type PropsWithDefault = "orientation" | "activationMode" | "loopFocus";
|
|
90
91
|
type TabsSchema = {
|
package/dist/index.js
CHANGED
|
@@ -504,8 +504,9 @@ var machine = core.createMachine({
|
|
|
504
504
|
const value = context.get("value");
|
|
505
505
|
if (!value) return;
|
|
506
506
|
const triggerEl = getTriggerEl(scope, value);
|
|
507
|
-
if (
|
|
508
|
-
|
|
507
|
+
if (domQuery.isAnchorElement(triggerEl)) {
|
|
508
|
+
prop("navigate")?.({ value, node: triggerEl, href: triggerEl.href });
|
|
509
|
+
}
|
|
509
510
|
}
|
|
510
511
|
}
|
|
511
512
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -502,8 +502,9 @@ var machine = createMachine({
|
|
|
502
502
|
const value = context.get("value");
|
|
503
503
|
if (!value) return;
|
|
504
504
|
const triggerEl = getTriggerEl(scope, value);
|
|
505
|
-
if (
|
|
506
|
-
|
|
505
|
+
if (isAnchorElement(triggerEl)) {
|
|
506
|
+
prop("navigate")?.({ value, node: triggerEl, href: triggerEl.href });
|
|
507
|
+
}
|
|
507
508
|
}
|
|
508
509
|
}
|
|
509
510
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/tabs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.1",
|
|
4
4
|
"description": "Core logic for the tabs widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@zag-js/anatomy": "1.
|
|
30
|
-
"@zag-js/dom-query": "1.
|
|
31
|
-
"@zag-js/utils": "1.
|
|
32
|
-
"@zag-js/core": "1.
|
|
33
|
-
"@zag-js/types": "1.
|
|
29
|
+
"@zag-js/anatomy": "1.12.1",
|
|
30
|
+
"@zag-js/dom-query": "1.12.1",
|
|
31
|
+
"@zag-js/utils": "1.12.1",
|
|
32
|
+
"@zag-js/core": "1.12.1",
|
|
33
|
+
"@zag-js/types": "1.12.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"clean-package": "2.2.0"
|