@pzerelles/headlessui-svelte 2.1.2-next.23 → 2.1.2-next.24
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/button/Button.svelte +84 -54
- package/dist/button/Button.svelte.d.ts +7 -4
- package/dist/checkbox/Checkbox.svelte +173 -120
- package/dist/checkbox/Checkbox.svelte.d.ts +7 -4
- package/dist/close-button/CloseButton.svelte +12 -6
- package/dist/close-button/CloseButton.svelte.d.ts +13 -10
- package/dist/combobox/Combobox.svelte +50 -3
- package/dist/data-interactive/DataInteractive.svelte +55 -29
- package/dist/data-interactive/DataInteractive.svelte.d.ts +7 -5
- package/dist/description/Description.svelte +31 -21
- package/dist/description/Description.svelte.d.ts +7 -4
- package/dist/dialog/Dialog.svelte +358 -38
- package/dist/dialog/Dialog.svelte.d.ts +10 -7
- package/dist/dialog/DialogBackdrop.svelte +30 -13
- package/dist/dialog/DialogBackdrop.svelte.d.ts +7 -4
- package/dist/dialog/DialogPanel.svelte +49 -26
- package/dist/dialog/DialogPanel.svelte.d.ts +7 -4
- package/dist/dialog/DialogTitle.svelte +38 -23
- package/dist/dialog/DialogTitle.svelte.d.ts +7 -4
- package/dist/field/Field.svelte +50 -28
- package/dist/field/Field.svelte.d.ts +7 -4
- package/dist/fieldset/Fieldset.svelte +50 -29
- package/dist/fieldset/Fieldset.svelte.d.ts +7 -4
- package/dist/focus-trap/FocusTrap.svelte +419 -283
- package/dist/focus-trap/FocusTrap.svelte.d.ts +7 -4
- package/dist/input/Input.svelte +84 -53
- package/dist/input/Input.svelte.d.ts +7 -4
- package/dist/internal/FloatingProvider.svelte +14 -9
- package/dist/internal/FocusSentinel.svelte +16 -8
- package/dist/internal/ForcePortalRoot.svelte +7 -3
- package/dist/internal/FormFields.svelte +47 -34
- package/dist/internal/FormFieldsProvider.svelte +9 -5
- package/dist/internal/FormResolver.svelte +20 -15
- package/dist/internal/Hidden.svelte +50 -29
- package/dist/internal/Hidden.svelte.d.ts +7 -4
- package/dist/internal/MainTreeProvider.svelte +89 -36
- package/dist/internal/Portal.svelte +18 -14
- package/dist/internal/floating-provider.svelte.js +1 -1
- package/dist/internal/floating.svelte.d.ts +5 -5
- package/dist/internal/floating.svelte.js +17 -17
- package/dist/label/Label.svelte +93 -58
- package/dist/label/Label.svelte.d.ts +7 -4
- package/dist/legend/Legend.svelte +12 -3
- package/dist/listbox/Listbox.svelte +525 -387
- package/dist/listbox/Listbox.svelte.d.ts +7 -5
- package/dist/listbox/ListboxButton.svelte +173 -127
- package/dist/listbox/ListboxButton.svelte.d.ts +7 -5
- package/dist/listbox/ListboxOption.svelte +170 -129
- package/dist/listbox/ListboxOption.svelte.d.ts +7 -5
- package/dist/listbox/ListboxOptions.svelte +400 -304
- package/dist/listbox/ListboxOptions.svelte.d.ts +7 -5
- package/dist/listbox/ListboxSelectedOption.svelte +38 -15
- package/dist/listbox/ListboxSelectedOption.svelte.d.ts +7 -4
- package/dist/listbox/index.d.ts +4 -4
- package/dist/listbox/index.js +1 -1
- package/dist/menu/Menu.svelte +78 -51
- package/dist/menu/Menu.svelte.d.ts +7 -5
- package/dist/menu/MenuButton.svelte +157 -117
- package/dist/menu/MenuButton.svelte.d.ts +7 -5
- package/dist/menu/MenuHeading.svelte +32 -14
- package/dist/menu/MenuHeading.svelte.d.ts +7 -5
- package/dist/menu/MenuItem.svelte +142 -107
- package/dist/menu/MenuItem.svelte.d.ts +8 -8
- package/dist/menu/MenuItems.svelte +301 -229
- package/dist/menu/MenuItems.svelte.d.ts +7 -5
- package/dist/menu/MenuSection.svelte +24 -9
- package/dist/menu/MenuSection.svelte.d.ts +7 -5
- package/dist/menu/MenuSeparator.svelte +17 -4
- package/dist/menu/MenuSeparator.svelte.d.ts +7 -6
- package/dist/menu/index.d.ts +7 -7
- package/dist/popover/Popover.svelte +216 -150
- package/dist/popover/Popover.svelte.d.ts +7 -4
- package/dist/popover/PopoverBackdrop.svelte +67 -41
- package/dist/popover/PopoverBackdrop.svelte.d.ts +7 -4
- package/dist/popover/PopoverButton.svelte +292 -212
- package/dist/popover/PopoverButton.svelte.d.ts +7 -4
- package/dist/popover/PopoverGroup.svelte +62 -35
- package/dist/popover/PopoverGroup.svelte.d.ts +7 -4
- package/dist/popover/PopoverPanel.svelte +311 -229
- package/dist/popover/PopoverPanel.svelte.d.ts +7 -4
- package/dist/portal/InternalPortal.svelte +141 -85
- package/dist/portal/InternalPortal.svelte.d.ts +7 -4
- package/dist/portal/Portal.svelte +5 -2
- package/dist/portal/PortalGroup.svelte +30 -9
- package/dist/portal/PortalGroup.svelte.d.ts +7 -4
- package/dist/select/Select.svelte +98 -68
- package/dist/select/Select.svelte.d.ts +7 -4
- package/dist/switch/Switch.svelte +179 -132
- package/dist/switch/Switch.svelte.d.ts +7 -4
- package/dist/switch/SwitchGroup.svelte +44 -31
- package/dist/switch/SwitchGroup.svelte.d.ts +7 -4
- package/dist/tabs/Tab.svelte +194 -143
- package/dist/tabs/Tab.svelte.d.ts +7 -4
- package/dist/tabs/TabGroup.svelte +81 -214
- package/dist/tabs/TabGroup.svelte.d.ts +7 -24
- package/dist/tabs/TabList.svelte +31 -11
- package/dist/tabs/TabList.svelte.d.ts +7 -4
- package/dist/tabs/TabPanel.svelte +67 -43
- package/dist/tabs/TabPanel.svelte.d.ts +7 -4
- package/dist/tabs/TabPanels.svelte +18 -7
- package/dist/tabs/TabPanels.svelte.d.ts +7 -4
- package/dist/tabs/context.svelte.d.ts +31 -0
- package/dist/tabs/context.svelte.js +134 -0
- package/dist/textarea/Textarea.svelte +84 -53
- package/dist/textarea/Textarea.svelte.d.ts +7 -4
- package/dist/transition/InternalTransitionChild.svelte +259 -170
- package/dist/transition/InternalTransitionChild.svelte.d.ts +7 -4
- package/dist/transition/Transition.svelte +96 -66
- package/dist/transition/Transition.svelte.d.ts +7 -4
- package/dist/transition/TransitionChild.svelte +31 -11
- package/dist/transition/TransitionChild.svelte.d.ts +7 -4
- package/dist/utils/ElementOrComponent.svelte +43 -23
- package/dist/utils/ElementOrComponent.svelte.d.ts +10 -4
- package/dist/utils/Generic.svelte +36 -22
- package/dist/utils/Generic.svelte.d.ts +7 -4
- package/dist/utils/StableCollection.svelte +54 -36
- package/dist/utils/floating-ui/svelte/components/FloatingNode.svelte +27 -12
- package/dist/utils/floating-ui/svelte/components/FloatingTree.svelte +88 -44
- package/dist/utils/floating-ui/svelte/hooks/useFloating.svelte.js +7 -7
- package/dist/utils/floating-ui/svelte/hooks/useFloatingRootContext.svelte.js +1 -1
- package/dist/utils/floating-ui/svelte/types.d.ts +4 -4
- package/dist/utils/floating-ui/svelte-dom/types.d.ts +2 -2
- package/dist/utils/floating-ui/svelte-dom/useFloating.svelte.js +6 -6
- package/dist/utils/types.d.ts +11 -4
- package/package.json +1 -1
- package/dist/dialog/InternalDialog.svelte +0 -233
- package/dist/dialog/InternalDialog.svelte.d.ts +0 -42
package/dist/tabs/Tab.svelte
CHANGED
|
@@ -1,156 +1,207 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { ElementType, Props } from "../utils/types.js"
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { useFocusRing } from "../hooks/use-focus-ring.svelte.js";
|
|
13
|
-
import { useResolveButtonType } from "../hooks/use-resolve-button-type.svelte.js";
|
|
14
|
-
import { onMount } from "svelte";
|
|
15
|
-
import { useHover } from "../hooks/use-hover.svelte.js";
|
|
16
|
-
import { mergeProps } from "../utils/render.js";
|
|
17
|
-
import ElementOrComponent from "../utils/ElementOrComponent.svelte";
|
|
18
|
-
const internalId = useId();
|
|
19
|
-
let {
|
|
20
|
-
ref = $bindable(),
|
|
21
|
-
id = `headlessui-tabs-tab-${internalId}`,
|
|
22
|
-
disabled = false,
|
|
23
|
-
autofocus = false,
|
|
24
|
-
...theirProps
|
|
25
|
-
} = $props();
|
|
26
|
-
const data = useData("Tab");
|
|
27
|
-
const { orientation, activation, selectedIndex, tabs, panels } = $derived(data);
|
|
28
|
-
const actions = useActions("Tab");
|
|
29
|
-
const tabRef = $derived({ current: ref });
|
|
30
|
-
onMount(() => actions.registerTab(tabRef));
|
|
31
|
-
const mySSRIndex = useStableCollectionIndex("tabs");
|
|
32
|
-
const myIndex = $derived.by(() => {
|
|
33
|
-
const index = tabs.findIndex((tab) => tab === tabRef);
|
|
34
|
-
return index === -1 ? mySSRIndex : index;
|
|
35
|
-
});
|
|
36
|
-
const selected = $derived(myIndex === selectedIndex);
|
|
37
|
-
const activateUsing = $derived((cb) => {
|
|
38
|
-
let result = cb();
|
|
39
|
-
if (result === FocusResult.Success && activation === "auto") {
|
|
40
|
-
let newTab = getOwnerDocument(ref)?.activeElement;
|
|
41
|
-
let idx = data.tabs.findIndex((tab) => tab.current === newTab);
|
|
42
|
-
if (idx !== -1) actions.change(idx);
|
|
43
|
-
}
|
|
44
|
-
return result;
|
|
45
|
-
});
|
|
46
|
-
const handleKeyDown = (event) => {
|
|
47
|
-
let list = tabs.map((tab) => tab.current).filter(Boolean);
|
|
48
|
-
if (event.key === " " || event.key === "Enter") {
|
|
49
|
-
event.preventDefault();
|
|
50
|
-
event.stopPropagation();
|
|
51
|
-
actions.change(myIndex);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
switch (event.key) {
|
|
55
|
-
case "Home":
|
|
56
|
-
case "PageUp":
|
|
57
|
-
event.preventDefault();
|
|
58
|
-
event.stopPropagation();
|
|
59
|
-
return activateUsing(() => focusIn(list, Focus.First));
|
|
60
|
-
case "End":
|
|
61
|
-
case "PageDown":
|
|
62
|
-
event.preventDefault();
|
|
63
|
-
event.stopPropagation();
|
|
64
|
-
return activateUsing(() => focusIn(list, Focus.Last));
|
|
4
|
+
const DEFAULT_TAB_TAG = "button" as const
|
|
5
|
+
type TabRenderPropArg = {
|
|
6
|
+
hover: boolean
|
|
7
|
+
focus: boolean
|
|
8
|
+
active: boolean
|
|
9
|
+
autofocus: boolean
|
|
10
|
+
selected: boolean
|
|
11
|
+
disabled: boolean
|
|
65
12
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return FocusResult.Error;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
if (result === FocusResult.Success) {
|
|
81
|
-
return event.preventDefault();
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
let ready = $state(false);
|
|
85
|
-
const handleSelection = () => {
|
|
86
|
-
if (ready) return;
|
|
87
|
-
ready = true;
|
|
88
|
-
ref?.focus({ preventScroll: true });
|
|
89
|
-
actions.change(myIndex);
|
|
90
|
-
microTask(() => {
|
|
91
|
-
ready = false;
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
const handleMouseDown = (event) => {
|
|
95
|
-
event.preventDefault();
|
|
96
|
-
};
|
|
97
|
-
const { isHovered: hover, hoverProps } = $derived(
|
|
98
|
-
useHover({
|
|
99
|
-
get disabled() {
|
|
100
|
-
return disabled;
|
|
13
|
+
type TabPropsWeControl = "aria-controls" | "aria-selected" | "role" | "tabIndex"
|
|
14
|
+
|
|
15
|
+
export type TabProps<TTag extends ElementType = typeof DEFAULT_TAB_TAG> = Props<
|
|
16
|
+
TTag,
|
|
17
|
+
TabRenderPropArg,
|
|
18
|
+
TabPropsWeControl,
|
|
19
|
+
{
|
|
20
|
+
id?: string
|
|
21
|
+
autofocus?: boolean
|
|
22
|
+
disabled?: boolean
|
|
101
23
|
}
|
|
24
|
+
>
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<script lang="ts" generics="TTag extends ElementType = typeof DEFAULT_TAB_TAG">
|
|
28
|
+
import { useId } from "../hooks/use-id.js"
|
|
29
|
+
import { useStableCollectionIndex } from "../utils/StableCollection.svelte"
|
|
30
|
+
import { Focus, focusIn, FocusResult } from "../utils/focus-management.js"
|
|
31
|
+
import { getOwnerDocument } from "../utils/owner.js"
|
|
32
|
+
import { match } from "../utils/match.js"
|
|
33
|
+
import { microTask } from "../utils/microTask.js"
|
|
34
|
+
import { useActivePress } from "../hooks/use-active-press.svelte.js"
|
|
35
|
+
import { useFocusRing } from "../hooks/use-focus-ring.svelte.js"
|
|
36
|
+
import { useResolveButtonType } from "../hooks/use-resolve-button-type.svelte.js"
|
|
37
|
+
import type { MutableRefObject } from "../utils/ref.svelte.js"
|
|
38
|
+
import { onMount } from "svelte"
|
|
39
|
+
import { useHover } from "../hooks/use-hover.svelte.js"
|
|
40
|
+
import { mergeProps } from "../utils/render.js"
|
|
41
|
+
import ElementOrComponent from "../utils/ElementOrComponent.svelte"
|
|
42
|
+
import { useTabs } from "./context.svelte.js"
|
|
43
|
+
|
|
44
|
+
const internalId = useId()
|
|
45
|
+
let {
|
|
46
|
+
ref = $bindable(),
|
|
47
|
+
id = `headlessui-tabs-tab-${internalId}`,
|
|
48
|
+
disabled = false,
|
|
49
|
+
autofocus = false,
|
|
50
|
+
...theirProps
|
|
51
|
+
}: { as?: TTag } & TabProps<TTag> = $props()
|
|
52
|
+
|
|
53
|
+
const context = useTabs("Tab")
|
|
54
|
+
const { orientation, activation, selectedIndex, tabs, panels, registerTab, change } = $derived(context)
|
|
55
|
+
|
|
56
|
+
const tabRef = $derived<MutableRefObject<HTMLElement | undefined>>({ current: ref })
|
|
57
|
+
|
|
58
|
+
onMount(() => registerTab(tabRef))
|
|
59
|
+
|
|
60
|
+
const mySSRIndex = useStableCollectionIndex("tabs")
|
|
61
|
+
|
|
62
|
+
const myIndex = $derived.by(() => {
|
|
63
|
+
const index = tabs.findIndex((tab) => tab === tabRef)
|
|
64
|
+
return index === -1 ? mySSRIndex : index
|
|
102
65
|
})
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
66
|
+
const selected = $derived(myIndex === selectedIndex)
|
|
67
|
+
|
|
68
|
+
const activateUsing = $derived((cb: () => FocusResult) => {
|
|
69
|
+
let result = cb()
|
|
70
|
+
if (result === FocusResult.Success && activation === "auto") {
|
|
71
|
+
let newTab = getOwnerDocument(ref)?.activeElement
|
|
72
|
+
let idx = context.tabs.findIndex((tab) => tab.current === newTab)
|
|
73
|
+
if (idx !== -1) change(idx)
|
|
108
74
|
}
|
|
75
|
+
return result
|
|
109
76
|
})
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
77
|
+
|
|
78
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
79
|
+
let list = tabs.map((tab) => tab.current).filter(Boolean) as HTMLElement[]
|
|
80
|
+
|
|
81
|
+
if (event.key === " " || event.key === "Enter") {
|
|
82
|
+
event.preventDefault()
|
|
83
|
+
event.stopPropagation()
|
|
84
|
+
|
|
85
|
+
change(myIndex)
|
|
86
|
+
return
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
switch (event.key) {
|
|
90
|
+
case "Home":
|
|
91
|
+
case "PageUp":
|
|
92
|
+
event.preventDefault()
|
|
93
|
+
event.stopPropagation()
|
|
94
|
+
|
|
95
|
+
return activateUsing(() => focusIn(list, Focus.First))
|
|
96
|
+
|
|
97
|
+
case "End":
|
|
98
|
+
case "PageDown":
|
|
99
|
+
event.preventDefault()
|
|
100
|
+
event.stopPropagation()
|
|
101
|
+
|
|
102
|
+
return activateUsing(() => focusIn(list, Focus.Last))
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
let result = activateUsing(() => {
|
|
106
|
+
return match(orientation, {
|
|
107
|
+
vertical() {
|
|
108
|
+
if (event.key === "ArrowUp") return focusIn(list, Focus.Previous | Focus.WrapAround)
|
|
109
|
+
if (event.key === "ArrowDown") return focusIn(list, Focus.Next | Focus.WrapAround)
|
|
110
|
+
return FocusResult.Error
|
|
111
|
+
},
|
|
112
|
+
horizontal() {
|
|
113
|
+
if (event.key === "ArrowLeft") return focusIn(list, Focus.Previous | Focus.WrapAround)
|
|
114
|
+
if (event.key === "ArrowRight") return focusIn(list, Focus.Next | Focus.WrapAround)
|
|
115
|
+
return FocusResult.Error
|
|
116
|
+
},
|
|
117
|
+
})
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
if (result === FocusResult.Success) {
|
|
121
|
+
return event.preventDefault()
|
|
115
122
|
}
|
|
116
|
-
})
|
|
117
|
-
);
|
|
118
|
-
const slot = $derived({
|
|
119
|
-
selected,
|
|
120
|
-
hover,
|
|
121
|
-
active,
|
|
122
|
-
focus,
|
|
123
|
-
autofocus,
|
|
124
|
-
disabled
|
|
125
|
-
});
|
|
126
|
-
const resolvedType = useResolveButtonType({
|
|
127
|
-
get props() {
|
|
128
|
-
return { type: theirProps.type, as: theirProps.as };
|
|
129
|
-
},
|
|
130
|
-
get ref() {
|
|
131
|
-
return tabRef;
|
|
132
123
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
124
|
+
|
|
125
|
+
let ready = $state(false)
|
|
126
|
+
const handleSelection = () => {
|
|
127
|
+
if (ready) return
|
|
128
|
+
ready = true
|
|
129
|
+
|
|
130
|
+
ref?.focus({ preventScroll: true })
|
|
131
|
+
change(myIndex)
|
|
132
|
+
|
|
133
|
+
microTask(() => {
|
|
134
|
+
ready = false
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// This is important because we want to only focus the tab when it gets focus
|
|
139
|
+
// OR it finished the click event (mouseup). However, if you perform a `click`,
|
|
140
|
+
// then you will first get the `focus` and then get the `click` event.
|
|
141
|
+
const handleMouseDown = (event: MouseEvent) => {
|
|
142
|
+
event.preventDefault()
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const { isHovered: hover, hoverProps } = $derived(
|
|
146
|
+
useHover({
|
|
147
|
+
get disabled() {
|
|
148
|
+
return disabled
|
|
149
|
+
},
|
|
150
|
+
})
|
|
151
|
+
)
|
|
152
|
+
const { pressed: active, pressProps } = $derived(
|
|
153
|
+
useActivePress({
|
|
154
|
+
get disabled() {
|
|
155
|
+
return disabled
|
|
156
|
+
},
|
|
157
|
+
})
|
|
158
|
+
)
|
|
159
|
+
const { isFocusVisible: focus, focusProps } = $derived(
|
|
160
|
+
useFocusRing({
|
|
161
|
+
get autofocus() {
|
|
162
|
+
return autofocus
|
|
163
|
+
},
|
|
164
|
+
})
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
const slot = $derived({
|
|
168
|
+
selected,
|
|
169
|
+
hover,
|
|
170
|
+
active,
|
|
171
|
+
focus,
|
|
172
|
+
autofocus,
|
|
173
|
+
disabled,
|
|
174
|
+
} satisfies TabRenderPropArg)
|
|
175
|
+
|
|
176
|
+
const resolvedType = useResolveButtonType({
|
|
177
|
+
get props() {
|
|
178
|
+
return { type: theirProps.type, as: theirProps.as }
|
|
179
|
+
},
|
|
180
|
+
get ref() {
|
|
181
|
+
return tabRef
|
|
148
182
|
},
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
const ourProps = $derived(
|
|
186
|
+
mergeProps(
|
|
187
|
+
{
|
|
188
|
+
onkeydown: handleKeyDown,
|
|
189
|
+
onmousedown: handleMouseDown,
|
|
190
|
+
onclick: handleSelection,
|
|
191
|
+
id,
|
|
192
|
+
role: "tab",
|
|
193
|
+
type: resolvedType.type,
|
|
194
|
+
"aria-controls": panels[myIndex]?.current?.id,
|
|
195
|
+
"aria-selected": selected,
|
|
196
|
+
tabIndex: selected ? 0 : -1,
|
|
197
|
+
disabled: disabled || undefined,
|
|
198
|
+
autofocus,
|
|
199
|
+
},
|
|
200
|
+
focusProps,
|
|
201
|
+
hoverProps,
|
|
202
|
+
pressProps
|
|
203
|
+
)
|
|
152
204
|
)
|
|
153
|
-
);
|
|
154
205
|
</script>
|
|
155
206
|
|
|
156
207
|
<ElementOrComponent {ourProps} {theirProps} {slot} defaultTag={DEFAULT_TAB_TAG} name="Tab" bind:ref />
|
|
@@ -17,11 +17,14 @@ export type TabProps<TTag extends ElementType = typeof DEFAULT_TAB_TAG> = Props<
|
|
|
17
17
|
declare class __sveltets_Render<TTag extends ElementType = typeof DEFAULT_TAB_TAG> {
|
|
18
18
|
props(): {
|
|
19
19
|
as?: TTag | undefined;
|
|
20
|
-
} & (Exclude<keyof import("../utils/types.js").PropsOf<TTag>, ("as" | "children" | "
|
|
21
|
-
children?: import("svelte").Snippet<[
|
|
20
|
+
} & (Exclude<keyof import("../utils/types.js").PropsOf<TTag>, ("as" | "children" | "class") | "disabled" | "autofocus" | "id" | TabPropsWeControl> extends infer T extends keyof import("../utils/types.js").PropsOf<TTag> ? { [P in T]: import("../utils/types.js").PropsOf<TTag>[P]; } : never) & {
|
|
21
|
+
children?: import("svelte").Snippet<[{
|
|
22
|
+
slot: TabRenderPropArg;
|
|
23
|
+
props: Record<string, any>;
|
|
24
|
+
}]> | undefined;
|
|
22
25
|
ref?: HTMLElement;
|
|
23
|
-
} & (true extends (import("
|
|
24
|
-
class?:
|
|
26
|
+
} & (true extends (import("svelte/elements.js").SvelteHTMLElements[TTag] extends infer T_1 ? T_1 extends import("svelte/elements.js").SvelteHTMLElements[TTag] ? T_1 extends never ? never : "class" extends infer T_2 ? T_2 extends "class" ? T_2 extends keyof T_1 ? true : never : never : never : never : never) ? {
|
|
27
|
+
class?: string | ((bag: TabRenderPropArg) => string) | null | undefined;
|
|
25
28
|
} : {}) & {
|
|
26
29
|
id?: string;
|
|
27
30
|
autofocus?: boolean;
|