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