@zag-js/tabs 2.0.0-next.2 → 2.0.0-next.4

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,296 +1,300 @@
1
- // src/tabs.machine.ts
2
- import { setup } from "@zag-js/core";
3
- import { clickIfLink, getFocusables, isAnchorElement, raf, resizeObserverBorderBox } from "@zag-js/dom-query";
1
+ import { getActivationDirection, getContentEl, getElements, getFirstTriggerEl, getIndicatorEl, getLastTriggerEl, getListEl, getSiblingTriggerEl, getTriggerEl, getTriggerRect } from "./tabs.dom.mjs";
2
+ import { AnimationFrame, addDomEvent, getFocusables, isAnchorElement, observeChildren, resizeObserverBorderBox } from "@zag-js/dom-query";
4
3
  import { callAll, isEqual } from "@zag-js/utils";
5
- import * as dom from "./tabs.dom.mjs";
6
- var { createMachine } = setup();
7
- var machine = createMachine({
8
- props({ props }) {
9
- return {
10
- dir: "ltr",
11
- orientation: "horizontal",
12
- activationMode: "automatic",
13
- loopFocus: true,
14
- navigate(details) {
15
- clickIfLink(details.node);
16
- },
17
- defaultValue: null,
18
- ...props
19
- };
20
- },
21
- initialState() {
22
- return "idle";
23
- },
24
- context({ prop, bindable }) {
25
- return {
26
- value: bindable(() => ({
27
- defaultValue: prop("defaultValue"),
28
- value: prop("value"),
29
- onChange(value) {
30
- prop("onValueChange")?.({ value });
31
- }
32
- })),
33
- focusedValue: bindable(() => ({
34
- defaultValue: prop("value") || prop("defaultValue"),
35
- sync: true,
36
- onChange(value) {
37
- prop("onFocusChange")?.({ focusedValue: value });
38
- }
39
- })),
40
- ssr: bindable(() => ({ defaultValue: true })),
41
- indicatorRect: bindable(() => ({
42
- defaultValue: null
43
- })),
44
- animateIndicator: bindable(() => ({
45
- defaultValue: false
46
- }))
47
- };
48
- },
49
- refs() {
50
- return {
51
- indicatorCleanup: null,
52
- prevValue: null
53
- };
54
- },
55
- watch({ context, prop, track, action }) {
56
- track([() => context.get("value")], () => {
57
- action(["syncIndicatorAnimation", "syncIndicatorRect", "syncTabIndex", "navigateIfNeeded"]);
58
- });
59
- track([() => prop("dir"), () => prop("orientation")], () => {
60
- action(["syncIndicatorRect"]);
61
- });
62
- },
63
- on: {
64
- SET_VALUE: {
65
- actions: ["setValue"]
66
- },
67
- CLEAR_VALUE: {
68
- actions: ["clearValue"]
69
- },
70
- SET_INDICATOR_RECT: {
71
- actions: ["setIndicatorRect"]
72
- },
73
- SYNC_TAB_INDEX: {
74
- actions: ["syncTabIndex"]
75
- },
76
- INDICATOR_TRANSITION_END: {
77
- actions: ["clearIndicatorAnimation"]
78
- }
79
- },
80
- entry: ["syncPrevValue", "syncIndicatorRect", "syncTabIndex", "syncSsr"],
81
- exit: ["cleanupObserver"],
82
- states: {
83
- idle: {
84
- on: {
85
- TAB_FOCUS: {
86
- target: "focused",
87
- actions: ["setFocusedValue"]
88
- },
89
- TAB_CLICK: {
90
- target: "focused",
91
- actions: ["setFocusedValue", "setValue"]
92
- }
93
- }
94
- },
95
- focused: {
96
- on: {
97
- TAB_CLICK: {
98
- actions: ["setFocusedValue", "setValue"]
99
- },
100
- ARROW_PREV: [
101
- {
102
- guard: "selectOnFocus",
103
- actions: ["focusPrevTab", "selectFocusedTab"]
104
- },
105
- {
106
- actions: ["focusPrevTab"]
107
- }
108
- ],
109
- ARROW_NEXT: [
110
- {
111
- guard: "selectOnFocus",
112
- actions: ["focusNextTab", "selectFocusedTab"]
113
- },
114
- {
115
- actions: ["focusNextTab"]
116
- }
117
- ],
118
- HOME: [
119
- {
120
- guard: "selectOnFocus",
121
- actions: ["focusFirstTab", "selectFocusedTab"]
122
- },
123
- {
124
- actions: ["focusFirstTab"]
125
- }
126
- ],
127
- END: [
128
- {
129
- guard: "selectOnFocus",
130
- actions: ["focusLastTab", "selectFocusedTab"]
131
- },
132
- {
133
- actions: ["focusLastTab"]
134
- }
135
- ],
136
- TAB_FOCUS: {
137
- actions: ["setFocusedValue"]
138
- },
139
- TAB_BLUR: {
140
- target: "idle",
141
- actions: ["clearFocusedValue"]
142
- }
143
- }
144
- }
145
- },
146
- implementations: {
147
- guards: {
148
- selectOnFocus: ({ prop }) => prop("activationMode") === "automatic"
149
- },
150
- actions: {
151
- selectFocusedTab({ context, prop }) {
152
- raf(() => {
153
- const focusedValue = context.get("focusedValue");
154
- if (!focusedValue) return;
155
- const nullable = prop("deselectable") && context.get("value") === focusedValue;
156
- const value = nullable ? null : focusedValue;
157
- context.set("value", value);
158
- });
159
- },
160
- setFocusedValue({ context, event, flush }) {
161
- if (event.value == null) return;
162
- flush(() => {
163
- context.set("focusedValue", event.value);
164
- });
165
- },
166
- clearFocusedValue({ context }) {
167
- context.set("focusedValue", null);
168
- },
169
- setValue({ context, event, prop }) {
170
- const nullable = prop("deselectable") && context.get("value") === context.get("focusedValue");
171
- context.set("value", nullable ? null : event.value);
172
- },
173
- clearValue({ context }) {
174
- context.set("value", null);
175
- },
176
- focusFirstTab({ scope }) {
177
- raf(() => {
178
- dom.getFirstTriggerEl(scope)?.focus();
179
- });
180
- },
181
- focusLastTab({ scope }) {
182
- raf(() => {
183
- dom.getLastTriggerEl(scope)?.focus();
184
- });
185
- },
186
- focusNextTab({ context, prop, scope, event }) {
187
- const focusedValue = event.value ?? context.get("focusedValue");
188
- if (!focusedValue) return;
189
- const triggerEl = dom.getNextTriggerEl(scope, {
190
- value: focusedValue,
191
- loopFocus: prop("loopFocus")
192
- });
193
- raf(() => {
194
- if (prop("virtualFocus")) {
195
- if (triggerEl?.dataset.value != null) {
196
- context.set("focusedValue", triggerEl.dataset.value);
197
- }
198
- } else {
199
- triggerEl?.focus();
200
- }
201
- });
202
- },
203
- focusPrevTab({ context, prop, scope, event }) {
204
- const focusedValue = event.value ?? context.get("focusedValue");
205
- if (!focusedValue) return;
206
- const triggerEl = dom.getPrevTriggerEl(scope, {
207
- value: focusedValue,
208
- loopFocus: prop("loopFocus")
209
- });
210
- raf(() => {
211
- if (prop("virtualFocus")) {
212
- if (triggerEl?.dataset.value != null) {
213
- context.set("focusedValue", triggerEl.dataset.value);
214
- }
215
- } else {
216
- triggerEl?.focus();
217
- }
218
- });
219
- },
220
- syncTabIndex({ context, scope }) {
221
- raf(() => {
222
- const value = context.get("value");
223
- if (!value) return;
224
- const contentEl = dom.getContentEl(scope, value);
225
- if (!contentEl) return;
226
- const focusables = getFocusables(contentEl);
227
- if (focusables.length > 0) {
228
- contentEl.removeAttribute("tabindex");
229
- } else {
230
- contentEl.setAttribute("tabindex", "0");
231
- }
232
- });
233
- },
234
- cleanupObserver({ refs }) {
235
- const cleanup = refs.get("indicatorCleanup");
236
- if (cleanup) cleanup();
237
- },
238
- setIndicatorRect({ context, event, scope }) {
239
- const value = event.id ?? context.get("value");
240
- const indicatorEl = dom.getIndicatorEl(scope);
241
- if (!indicatorEl) return;
242
- if (!value) return;
243
- const triggerEl = dom.getTriggerEl(scope, value);
244
- if (!triggerEl) return;
245
- context.set("indicatorRect", dom.getRectByValue(scope, value));
246
- },
247
- syncSsr({ context }) {
248
- context.set("ssr", false);
249
- },
250
- syncPrevValue({ context, refs }) {
251
- refs.set("prevValue", context.get("value"));
252
- },
253
- syncIndicatorAnimation({ context, refs }) {
254
- const prevValue = refs.get("prevValue");
255
- const nextValue = context.get("value");
256
- const animate = prevValue != null && nextValue != null && prevValue !== nextValue;
257
- context.set("animateIndicator", animate);
258
- refs.set("prevValue", nextValue);
259
- },
260
- clearIndicatorAnimation({ context }) {
261
- context.set("animateIndicator", false);
262
- },
263
- syncIndicatorRect({ context, refs, scope }) {
264
- const cleanup = refs.get("indicatorCleanup");
265
- if (cleanup) cleanup();
266
- const indicatorEl = dom.getIndicatorEl(scope);
267
- if (!indicatorEl) return;
268
- const exec = () => {
269
- const triggerEl = dom.getTriggerEl(scope, context.get("value"));
270
- if (!triggerEl) return;
271
- const rect = dom.getOffsetRect(triggerEl);
272
- context.set("indicatorRect", (prev) => isEqual(prev, rect) ? prev : rect);
273
- };
274
- exec();
275
- const triggerEls = dom.getElements(scope);
276
- const listEl = dom.getListEl(scope);
277
- const indicatorCleanup = callAll(
278
- ...triggerEls.map((el) => resizeObserverBorderBox.observe(el, exec)),
279
- ...listEl ? [resizeObserverBorderBox.observe(listEl, exec)] : []
280
- );
281
- refs.set("indicatorCleanup", indicatorCleanup);
282
- },
283
- navigateIfNeeded({ context, prop, scope }) {
284
- const value = context.get("value");
285
- if (!value) return;
286
- const triggerEl = dom.getTriggerEl(scope, value);
287
- if (isAnchorElement(triggerEl)) {
288
- prop("navigate")?.({ value, node: triggerEl, href: triggerEl.href });
289
- }
290
- }
291
- }
292
- }
4
+ import { setup } from "@zag-js/core";
5
+ // src/tabs.machine.ts
6
+ const { createMachine } = setup();
7
+ const machine = createMachine({
8
+ props({ props }) {
9
+ return {
10
+ dir: "ltr",
11
+ orientation: "horizontal",
12
+ activationMode: "automatic",
13
+ loopFocus: true,
14
+ defaultValue: null,
15
+ ...props
16
+ };
17
+ },
18
+ initialState() {
19
+ return "idle";
20
+ },
21
+ context({ prop, bindable, scope, getEvent }) {
22
+ return {
23
+ value: bindable(() => ({
24
+ defaultValue: prop("defaultValue"),
25
+ value: prop("value"),
26
+ onChange(value, prevValue) {
27
+ const activationDirection = getActivationDirection(scope, prevValue ?? null, value, prop("orientation"));
28
+ const reason = getEvent().src;
29
+ prop("onValueChange")?.({
30
+ value,
31
+ activationDirection,
32
+ reason
33
+ });
34
+ }
35
+ })),
36
+ focusedValue: bindable(() => ({
37
+ defaultValue: prop("value") || prop("defaultValue"),
38
+ sync: true,
39
+ onChange(value) {
40
+ prop("onFocusChange")?.({ focusedValue: value });
41
+ }
42
+ })),
43
+ ssr: bindable(() => ({ defaultValue: true })),
44
+ indicatorRect: bindable(() => ({ defaultValue: null })),
45
+ indicatorInstant: bindable(() => ({ defaultValue: false })),
46
+ tabStopValue: bindable(() => ({ defaultValue: null })),
47
+ hasFocusableContent: bindable(() => ({ defaultValue: false })),
48
+ activationDirection: bindable(() => ({ defaultValue: "none" }))
49
+ };
50
+ },
51
+ refs({ prop }) {
52
+ return {
53
+ previousValue: prop("value") ?? prop("defaultValue") ?? null,
54
+ indicatorCleanup: null,
55
+ indicatorFrame: AnimationFrame.create(),
56
+ focusFrame: AnimationFrame.create(),
57
+ selectFrame: AnimationFrame.create(),
58
+ tabIndexFrame: AnimationFrame.create(),
59
+ directionFrame: AnimationFrame.create()
60
+ };
61
+ },
62
+ computed: { activationDirection({ context, refs, scope, prop }) {
63
+ const value = context.get("value");
64
+ const previousValue = refs.get("previousValue");
65
+ if (value === previousValue) return context.get("activationDirection");
66
+ return getActivationDirection(scope, previousValue, value, prop("orientation"));
67
+ } },
68
+ watch({ context, prop, track, action }) {
69
+ track([() => context.get("value")], () => {
70
+ action([
71
+ "setActivationDirection",
72
+ "syncIndicatorRect",
73
+ "syncTabIndex",
74
+ "syncTabStopValue"
75
+ ]);
76
+ });
77
+ track([() => prop("dir"), () => prop("orientation")], () => {
78
+ action(["snapIndicator", "syncIndicatorRect"]);
79
+ });
80
+ },
81
+ on: {
82
+ "TRIGGER.FOCUS": {
83
+ target: "focused",
84
+ actions: ["setFocusedValue"]
85
+ },
86
+ "TRIGGER.CLICK": {
87
+ target: "focused",
88
+ actions: [
89
+ "setFocusedValue",
90
+ "toggleValue",
91
+ "requestNavigation"
92
+ ]
93
+ },
94
+ "TRIGGERS.CHANGE": { actions: ["syncTabStopValue", "syncIndicatorRect"] },
95
+ "VALUE.SET": { actions: ["setValue"] },
96
+ "VALUE.STEP": [{
97
+ guard: "isVirtualFocus",
98
+ target: "focused",
99
+ actions: ["stepValue"]
100
+ }, { actions: ["stepValue"] }],
101
+ "INDICATOR.SET": { actions: ["setIndicatorRect"] },
102
+ "INDICATOR.RESIZE": [{
103
+ guard: "isIndicatorTransitioning",
104
+ actions: ["setResizedIndicatorRect"]
105
+ }, { actions: ["snapIndicator", "setResizedIndicatorRect"] }],
106
+ "CONTENT.SYNC": { actions: ["syncTabIndex"] }
107
+ },
108
+ effects: ["trackTriggers"],
109
+ entry: [
110
+ "syncIndicatorRect",
111
+ "syncTabIndex",
112
+ "syncTabStopValue",
113
+ "syncSsr"
114
+ ],
115
+ exit: ["cleanupObserver", "cancelFrames"],
116
+ states: {
117
+ idle: {},
118
+ focused: {
119
+ exit: ["cancelFocusFrame"],
120
+ on: {
121
+ "FOCUS.MOVE": [{
122
+ guard: "selectOnFocus",
123
+ actions: ["moveFocus", "selectFocusedTab"]
124
+ }, { actions: ["moveFocus"] }],
125
+ "TRIGGER.BLUR": {
126
+ target: "idle",
127
+ actions: ["clearFocusedValue"]
128
+ }
129
+ }
130
+ }
131
+ },
132
+ implementations: {
133
+ guards: {
134
+ selectOnFocus: ({ prop }) => prop("activationMode") === "automatic",
135
+ isIndicatorTransitioning: ({ event }) => !!event.transitioning,
136
+ isVirtualFocus: ({ prop }) => !!prop("virtualFocus")
137
+ },
138
+ actions: {
139
+ selectFocusedTab({ context, prop, event, scope, refs, send }) {
140
+ refs.get("selectFrame").request(() => {
141
+ const value = context.get("focusedValue");
142
+ if (!value || context.get("value") === value) return;
143
+ if (event.src === "keyboard") {
144
+ const triggerEl = getTriggerEl(scope, value);
145
+ if (isAnchorElement(triggerEl) && prop("navigate") !== null) {
146
+ triggerEl.click();
147
+ return;
148
+ }
149
+ }
150
+ send({
151
+ type: "VALUE.SET",
152
+ value,
153
+ src: "keyboard"
154
+ });
155
+ });
156
+ },
157
+ setFocusedValue({ context, event, flush }) {
158
+ if (event.value == null) return;
159
+ flush(() => {
160
+ context.set("focusedValue", event.value);
161
+ });
162
+ },
163
+ clearFocusedValue({ context }) {
164
+ context.set("focusedValue", null);
165
+ },
166
+ setValue({ context, event }) {
167
+ context.set("value", event.value);
168
+ },
169
+ toggleValue({ context, event, prop }) {
170
+ const deselect = prop("deselectable") && context.get("value") === event.value;
171
+ context.set("value", deselect ? null : event.value);
172
+ },
173
+ syncTabStopValue({ context, scope }) {
174
+ const selectedEl = getTriggerEl(scope, context.get("value"));
175
+ const reachable = selectedEl != null && !selectedEl.hasAttribute("disabled");
176
+ context.set("tabStopValue", reachable ? null : getFirstTriggerEl(scope)?.dataset.value ?? null);
177
+ },
178
+ moveFocus(params) {
179
+ const { context, prop, scope, event } = params;
180
+ const focusedValue = context.get("focusedValue");
181
+ focusTrigger(params, () => {
182
+ if (event.to === "first") return getFirstTriggerEl(scope);
183
+ if (event.to === "last") return getLastTriggerEl(scope);
184
+ if (!focusedValue) return null;
185
+ return getSiblingTriggerEl(scope, focusedValue, event.to === "next" ? 1 : -1, prop("loopFocus"));
186
+ });
187
+ },
188
+ stepValue({ context, prop, scope, event }) {
189
+ const value = getSiblingTriggerEl(scope, event.from ?? context.get("value"), event.step, prop("loopFocus"))?.dataset.value;
190
+ if (value == null) return;
191
+ context.set("value", value);
192
+ if (prop("virtualFocus")) context.set("focusedValue", value);
193
+ },
194
+ setActivationDirection({ refs, computed, context, scope, prop }) {
195
+ const previousValue = refs.get("previousValue");
196
+ const value = context.get("value");
197
+ context.set("activationDirection", computed("activationDirection"));
198
+ refs.set("previousValue", value);
199
+ if (value == null || getTriggerEl(scope, value)) return;
200
+ refs.get("directionFrame").request(() => {
201
+ context.set("activationDirection", getActivationDirection(scope, previousValue, value, prop("orientation")));
202
+ });
203
+ },
204
+ syncTabIndex({ context, scope, refs }) {
205
+ refs.get("tabIndexFrame").request(() => {
206
+ const contentEl = getContentEl(scope, context.get("value") ?? "");
207
+ context.set("hasFocusableContent", contentEl != null && getFocusables(contentEl).length > 0);
208
+ });
209
+ },
210
+ cancelFocusFrame({ refs }) {
211
+ refs.get("focusFrame").cancel();
212
+ },
213
+ cancelFrames({ refs }) {
214
+ refs.get("focusFrame").cancel();
215
+ refs.get("indicatorFrame").cancel();
216
+ refs.get("selectFrame").cancel();
217
+ refs.get("tabIndexFrame").cancel();
218
+ refs.get("directionFrame").cancel();
219
+ },
220
+ cleanupObserver({ refs }) {
221
+ const cleanup = refs.get("indicatorCleanup");
222
+ if (cleanup) cleanup();
223
+ },
224
+ setIndicatorRect({ context, event, scope }) {
225
+ if (!getIndicatorEl(scope)) return;
226
+ const triggerEl = getTriggerEl(scope, event.value ?? context.get("value"));
227
+ if (!triggerEl) return;
228
+ context.set("indicatorRect", getTriggerRect(scope, triggerEl));
229
+ },
230
+ syncSsr({ context }) {
231
+ context.set("ssr", false);
232
+ },
233
+ snapIndicator({ context, refs }) {
234
+ const frame = refs.get("indicatorFrame");
235
+ context.set("indicatorInstant", true);
236
+ frame.request(() => frame.request(() => context.set("indicatorInstant", false)));
237
+ },
238
+ setResizedIndicatorRect({ context, event }) {
239
+ context.set("indicatorRect", event.rect);
240
+ },
241
+ syncIndicatorRect({ context, refs, scope, send }) {
242
+ const cleanup = refs.get("indicatorCleanup");
243
+ if (cleanup) cleanup();
244
+ const indicatorEl = getIndicatorEl(scope);
245
+ if (!indicatorEl) return;
246
+ const getRect = () => {
247
+ const triggerEl = getTriggerEl(scope, context.get("value"));
248
+ return triggerEl ? getTriggerRect(scope, triggerEl) : null;
249
+ };
250
+ const rect = getRect();
251
+ if (rect) context.set("indicatorRect", (prev) => isEqual(prev, rect) ? prev : rect);
252
+ const onResize = () => {
253
+ const rect = getRect();
254
+ if (!rect || isEqual(context.get("indicatorRect"), rect)) return;
255
+ send({
256
+ type: "INDICATOR.RESIZE",
257
+ rect,
258
+ transitioning: indicatorEl.getAnimations?.().length > 0
259
+ });
260
+ };
261
+ const triggerEls = getElements(scope);
262
+ const listEl = getListEl(scope);
263
+ const indicatorCleanup = callAll(...triggerEls.map((el) => resizeObserverBorderBox.observe(el, onResize)), ...listEl ? [resizeObserverBorderBox.observe(listEl, onResize), addDomEvent(listEl, "scroll", onResize, { passive: true })] : []);
264
+ refs.set("indicatorCleanup", indicatorCleanup);
265
+ },
266
+ requestNavigation({ event, prop, scope }) {
267
+ const navigate = prop("navigate");
268
+ if (!navigate || event.value == null) return;
269
+ const node = getTriggerEl(scope, event.value);
270
+ if (!isAnchorElement(node)) return;
271
+ navigate({
272
+ value: event.value,
273
+ node,
274
+ href: node.href
275
+ });
276
+ }
277
+ },
278
+ effects: { trackTriggers({ scope, send }) {
279
+ return observeChildren(() => getListEl(scope), {
280
+ attributes: true,
281
+ attributeFilter: ["disabled"],
282
+ callback() {
283
+ send({ type: "TRIGGERS.CHANGE" });
284
+ }
285
+ });
286
+ } }
287
+ }
293
288
  });
294
- export {
295
- machine
296
- };
289
+ function focusTrigger(params, getTriggerEl) {
290
+ const { context, prop, refs } = params;
291
+ refs.get("focusFrame").request(() => {
292
+ const triggerEl = getTriggerEl();
293
+ if (!prop("virtualFocus")) {
294
+ triggerEl?.focus();
295
+ return;
296
+ }
297
+ if (triggerEl?.dataset.value != null) context.set("focusedValue", triggerEl.dataset.value);
298
+ });
299
+ }
300
+ export { machine };
@@ -1,12 +1,7 @@
1
- import { TabsProps, ContentProps, TriggerProps } from './tabs.types.mjs';
2
- import '@zag-js/core';
3
- import '@zag-js/types';
4
-
5
- declare const props: (keyof TabsProps)[];
6
- declare const splitProps: <Props extends Partial<TabsProps>>(props: Props) => [Partial<TabsProps>, Omit<Props, keyof TabsProps>];
7
- declare const triggerProps: (keyof TriggerProps)[];
8
- declare const splitTriggerProps: <Props extends TriggerProps>(props: Props) => [TriggerProps, Omit<Props, keyof TriggerProps>];
9
- declare const contentProps: "value"[];
10
- declare const splitContentProps: <Props extends ContentProps>(props: Props) => [ContentProps, Omit<Props, "value">];
11
-
12
- export { contentProps, props, splitContentProps, splitProps, splitTriggerProps, triggerProps };
1
+ import { ContentProps, TabsProps, TriggerProps } from "./tabs.types.mjs";
2
+ export declare const props: (keyof TabsProps)[];
3
+ export declare const splitProps: <Props extends Partial<TabsProps>>(props: Props) => [Partial<TabsProps>, Omit<Props, keyof TabsProps>];
4
+ export declare const triggerProps: (keyof TriggerProps)[];
5
+ export declare const splitTriggerProps: <Props extends TriggerProps>(props: Props) => [TriggerProps, Omit<Props, keyof TriggerProps>];
6
+ export declare const contentProps: "value"[];
7
+ export declare const splitContentProps: <Props extends ContentProps>(props: Props) => [ContentProps, Omit<Props, "value">];
@@ -1,12 +1,7 @@
1
- import { TabsProps, ContentProps, TriggerProps } from './tabs.types.js';
2
- import '@zag-js/core';
3
- import '@zag-js/types';
4
-
5
- declare const props: (keyof TabsProps)[];
6
- declare const splitProps: <Props extends Partial<TabsProps>>(props: Props) => [Partial<TabsProps>, Omit<Props, keyof TabsProps>];
7
- declare const triggerProps: (keyof TriggerProps)[];
8
- declare const splitTriggerProps: <Props extends TriggerProps>(props: Props) => [TriggerProps, Omit<Props, keyof TriggerProps>];
9
- declare const contentProps: "value"[];
10
- declare const splitContentProps: <Props extends ContentProps>(props: Props) => [ContentProps, Omit<Props, "value">];
11
-
12
- export { contentProps, props, splitContentProps, splitProps, splitTriggerProps, triggerProps };
1
+ import { ContentProps, TabsProps, TriggerProps } from "./tabs.types.js";
2
+ export declare const props: (keyof TabsProps)[];
3
+ export declare const splitProps: <Props extends Partial<TabsProps>>(props: Props) => [Partial<TabsProps>, Omit<Props, keyof TabsProps>];
4
+ export declare const triggerProps: (keyof TriggerProps)[];
5
+ export declare const splitTriggerProps: <Props extends TriggerProps>(props: Props) => [TriggerProps, Omit<Props, keyof TriggerProps>];
6
+ export declare const contentProps: "value"[];
7
+ export declare const splitContentProps: <Props extends ContentProps>(props: Props) => [ContentProps, Omit<Props, "value">];