@zag-js/tabs 0.1.10 → 0.1.13

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.
@@ -1,120 +0,0 @@
1
- import type { StateMachine as S } from "@zag-js/core";
2
- import type { CommonProperties, Context, DirectionProperty, RequiredBy } from "@zag-js/types";
3
- declare type IntlMessages = {
4
- tablistLabel?: string;
5
- deleteLabel?(value: string): string;
6
- };
7
- declare type ElementIds = Partial<{
8
- root: string;
9
- trigger: string;
10
- triggerGroup: string;
11
- contentGroup: string;
12
- content: string;
13
- }>;
14
- declare type PublicContext = DirectionProperty & CommonProperties & {
15
- /**
16
- * The ids of the elements in the tabs. Useful for composition.
17
- */
18
- ids?: ElementIds;
19
- /**
20
- * Specifies the localized strings that identifies the accessibility elements and their states
21
- */
22
- messages: IntlMessages;
23
- /**
24
- * Whether the keyboard navigation will loop from last tab to first, and vice versa.
25
- * @default true
26
- */
27
- loop: boolean;
28
- /**
29
- * Whether the indicator is rendered.
30
- */
31
- isIndicatorRendered: boolean;
32
- /**
33
- * The selected tab id
34
- */
35
- value: string | null;
36
- /**
37
- * The orientation of the tabs. Can be `horizontal` or `vertical`
38
- * - `horizontal`: only left and right arrow key navigation will work.
39
- * - `vertical`: only up and down arrow key navigation will work.
40
- *
41
- * @default "horizontal"
42
- */
43
- orientation?: "horizontal" | "vertical";
44
- /**
45
- * The activation mode of the tabs. Can be `manual` or `automatic`
46
- * - `manual`: Tabs are activated when clicked or press `enter` key.
47
- * - `automatic`: Tabs are activated when receiving focus
48
- * @default "automatic"
49
- */
50
- activationMode?: "manual" | "automatic";
51
- /**
52
- * Callback to be called when the selected/active tab changes
53
- */
54
- onChange?: (details: {
55
- value: string | null;
56
- }) => void;
57
- /**
58
- * Callback to be called when the focused tab changes
59
- */
60
- onFocus?: (details: {
61
- value: string | null;
62
- }) => void;
63
- /**
64
- * Callback to be called when a tab's close button is clicked
65
- */
66
- onDelete?: (details: {
67
- value: string;
68
- }) => void;
69
- };
70
- export declare type UserDefinedContext = RequiredBy<PublicContext, "id">;
71
- declare type ComputedContext = Readonly<{
72
- /**
73
- * @computed
74
- * Whether the tab is in the horizontal orientation
75
- */
76
- isHorizontal: boolean;
77
- /**
78
- * @computed
79
- * Whether the tab is in the vertical orientation
80
- */
81
- isVertical: boolean;
82
- }>;
83
- declare type PrivateContext = Context<{
84
- /**
85
- * @internal
86
- * The focused tab id
87
- */
88
- focusedValue: string | null;
89
- /**
90
- * @internal
91
- * The active tab indicator's dom rect
92
- */
93
- indicatorRect?: Partial<{
94
- left: string;
95
- top: string;
96
- width: string;
97
- height: string;
98
- }>;
99
- /**
100
- * @internal
101
- * Whether the active tab indicator's rect has been measured
102
- */
103
- hasMeasuredRect?: boolean;
104
- /**
105
- * @internal
106
- * The previously selected tab ids. This is useful for performance optimization
107
- */
108
- previousValues: string[];
109
- }>;
110
- export declare type MachineContext = PublicContext & ComputedContext & PrivateContext;
111
- export declare type MachineState = {
112
- value: "unknown" | "idle" | "focused";
113
- };
114
- export declare type State = S.State<MachineContext, MachineState>;
115
- export declare type Send = S.Send<S.AnyEventObject>;
116
- export declare type TabProps = {
117
- value: string;
118
- disabled?: boolean;
119
- };
120
- export {};