@pzerelles/headlessui-svelte 2.1.2-next.23 → 2.1.2-next.25
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 -5
- package/dist/checkbox/Checkbox.svelte +173 -120
- package/dist/checkbox/Checkbox.svelte.d.ts +7 -5
- package/dist/close-button/CloseButton.svelte +12 -6
- package/dist/close-button/CloseButton.svelte.d.ts +13 -11
- package/dist/combobox/Combobox.svelte +50 -3
- package/dist/data-interactive/DataInteractive.svelte +55 -29
- package/dist/data-interactive/DataInteractive.svelte.d.ts +7 -6
- package/dist/description/Description.svelte +31 -21
- package/dist/description/Description.svelte.d.ts +7 -5
- package/dist/dialog/Dialog.svelte +358 -38
- package/dist/dialog/Dialog.svelte.d.ts +10 -8
- package/dist/dialog/DialogBackdrop.svelte +30 -13
- package/dist/dialog/DialogBackdrop.svelte.d.ts +7 -5
- package/dist/dialog/DialogPanel.svelte +49 -26
- package/dist/dialog/DialogPanel.svelte.d.ts +7 -5
- package/dist/dialog/DialogTitle.svelte +38 -23
- package/dist/dialog/DialogTitle.svelte.d.ts +7 -5
- package/dist/field/Field.svelte +50 -28
- package/dist/field/Field.svelte.d.ts +7 -5
- package/dist/fieldset/Fieldset.svelte +50 -29
- package/dist/fieldset/Fieldset.svelte.d.ts +7 -5
- package/dist/focus-trap/FocusTrap.svelte +419 -283
- package/dist/focus-trap/FocusTrap.svelte.d.ts +7 -5
- package/dist/input/Input.svelte +84 -53
- package/dist/input/Input.svelte.d.ts +7 -5
- 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 -5
- 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 -5
- package/dist/legend/Legend.svelte +12 -3
- package/dist/listbox/Listbox.svelte +525 -387
- package/dist/listbox/Listbox.svelte.d.ts +7 -6
- package/dist/listbox/ListboxButton.svelte +173 -127
- package/dist/listbox/ListboxButton.svelte.d.ts +7 -6
- package/dist/listbox/ListboxOption.svelte +170 -129
- package/dist/listbox/ListboxOption.svelte.d.ts +7 -6
- package/dist/listbox/ListboxOptions.svelte +400 -304
- package/dist/listbox/ListboxOptions.svelte.d.ts +7 -6
- package/dist/listbox/ListboxSelectedOption.svelte +38 -15
- package/dist/listbox/ListboxSelectedOption.svelte.d.ts +7 -5
- 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 -6
- package/dist/menu/MenuButton.svelte +157 -117
- package/dist/menu/MenuButton.svelte.d.ts +7 -6
- package/dist/menu/MenuHeading.svelte +32 -14
- package/dist/menu/MenuHeading.svelte.d.ts +7 -6
- package/dist/menu/MenuItem.svelte +142 -107
- package/dist/menu/MenuItem.svelte.d.ts +8 -10
- package/dist/menu/MenuItems.svelte +301 -229
- package/dist/menu/MenuItems.svelte.d.ts +7 -6
- package/dist/menu/MenuSection.svelte +24 -9
- package/dist/menu/MenuSection.svelte.d.ts +7 -6
- package/dist/menu/MenuSeparator.svelte +17 -4
- package/dist/menu/MenuSeparator.svelte.d.ts +7 -7
- package/dist/menu/index.d.ts +7 -7
- package/dist/popover/Popover.svelte +216 -150
- package/dist/popover/Popover.svelte.d.ts +7 -5
- package/dist/popover/PopoverBackdrop.svelte +67 -41
- package/dist/popover/PopoverBackdrop.svelte.d.ts +7 -5
- package/dist/popover/PopoverButton.svelte +292 -212
- package/dist/popover/PopoverButton.svelte.d.ts +7 -5
- package/dist/popover/PopoverGroup.svelte +62 -35
- package/dist/popover/PopoverGroup.svelte.d.ts +7 -5
- package/dist/popover/PopoverPanel.svelte +311 -229
- package/dist/popover/PopoverPanel.svelte.d.ts +7 -5
- package/dist/portal/InternalPortal.svelte +141 -85
- package/dist/portal/InternalPortal.svelte.d.ts +7 -5
- package/dist/portal/Portal.svelte +5 -2
- package/dist/portal/PortalGroup.svelte +30 -9
- package/dist/portal/PortalGroup.svelte.d.ts +7 -5
- package/dist/select/Select.svelte +98 -68
- package/dist/select/Select.svelte.d.ts +7 -5
- package/dist/switch/Switch.svelte +179 -132
- package/dist/switch/Switch.svelte.d.ts +7 -5
- package/dist/switch/SwitchGroup.svelte +44 -31
- package/dist/switch/SwitchGroup.svelte.d.ts +7 -5
- package/dist/tabs/Tab.svelte +194 -143
- package/dist/tabs/Tab.svelte.d.ts +7 -5
- package/dist/tabs/TabGroup.svelte +81 -214
- package/dist/tabs/TabGroup.svelte.d.ts +7 -25
- package/dist/tabs/TabList.svelte +31 -11
- package/dist/tabs/TabList.svelte.d.ts +7 -5
- package/dist/tabs/TabPanel.svelte +67 -43
- package/dist/tabs/TabPanel.svelte.d.ts +7 -5
- package/dist/tabs/TabPanels.svelte +18 -7
- package/dist/tabs/TabPanels.svelte.d.ts +7 -5
- 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 -5
- package/dist/transition/InternalTransitionChild.svelte +259 -170
- package/dist/transition/InternalTransitionChild.svelte.d.ts +7 -5
- package/dist/transition/Transition.svelte +96 -66
- package/dist/transition/Transition.svelte.d.ts +7 -5
- package/dist/transition/TransitionChild.svelte +31 -11
- package/dist/transition/TransitionChild.svelte.d.ts +7 -5
- package/dist/utils/ElementOrComponent.svelte +43 -23
- package/dist/utils/ElementOrComponent.svelte.d.ts +10 -5
- package/dist/utils/Generic.svelte +36 -22
- package/dist/utils/Generic.svelte.d.ts +12 -10
- 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 +9 -12
- package/package.json +6 -6
- package/dist/dialog/InternalDialog.svelte +0 -233
- package/dist/dialog/InternalDialog.svelte.d.ts +0 -42
|
@@ -22,17 +22,18 @@ export type ListboxProps<TTag extends ElementType = typeof DEFAULT_LISTBOX_TAG,
|
|
|
22
22
|
closeOnSelect?: boolean;
|
|
23
23
|
__demoMode?: boolean;
|
|
24
24
|
}>;
|
|
25
|
-
export type ListboxChildren<T> = Snippet<[ListboxRenderPropArg<T>]>;
|
|
26
25
|
export * from "./context.svelte.js";
|
|
27
26
|
declare class __sveltets_Render<TType, TActualType, TTag extends ElementType = typeof DEFAULT_LISTBOX_TAG> {
|
|
28
27
|
props(): {
|
|
29
28
|
as?: TTag | undefined;
|
|
30
|
-
} & (Exclude<keyof import("../utils/types.js").PropsOf<TTag>, "form" | ("as" | "children" | "
|
|
31
|
-
children?: Snippet<[
|
|
29
|
+
} & (Exclude<keyof import("../utils/types.js").PropsOf<TTag>, "form" | ("slot" | "as" | "children" | "class" | "ref") | "invalid" | "disabled" | "value" | "name" | "onchange" | "multiple" | "__demoMode" | "horizontal" | "defaultValue" | "by" | "closeOnSelect"> extends infer T extends keyof import("../utils/types.js").PropsOf<TTag> ? { [P in T]: import("../utils/types.js").PropsOf<TTag>[P]; } : never) & {
|
|
30
|
+
children?: Snippet<[{
|
|
31
|
+
slot: ListboxRenderPropArg<TType>;
|
|
32
|
+
props: Record<string, any>;
|
|
33
|
+
}]> | undefined;
|
|
34
|
+
class?: string | ((bag: ListboxRenderPropArg<TType>) => string) | null | undefined;
|
|
32
35
|
ref?: HTMLElement;
|
|
33
|
-
} &
|
|
34
|
-
class?: import("../utils/types.js").PropsOf<TTag>["class"] | ((bag: ListboxRenderPropArg<TType>) => string) | undefined;
|
|
35
|
-
} : {}) & {
|
|
36
|
+
} & {
|
|
36
37
|
value?: TType | undefined;
|
|
37
38
|
defaultValue?: TType | undefined;
|
|
38
39
|
onchange?: ((value: TType) => void) | undefined;
|
|
@@ -1,139 +1,185 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { useId } from "../hooks/use-id.js"
|
|
3
|
+
import { useProvidedId } from "../utils/id.js"
|
|
4
|
+
import type { ElementType, Props, PropsOf } from "../utils/types.js"
|
|
5
|
+
import { ListboxStates, useActions, useData } from "./Listbox.svelte"
|
|
6
|
+
import { attemptSubmit } from "../utils/form.js"
|
|
7
|
+
import { Focus } from "../utils/calculate-active-index.js"
|
|
8
|
+
import { useFocusRing } from "../hooks/use-focus-ring.svelte.js"
|
|
9
|
+
import { useActivePress } from "../hooks/use-active-press.svelte.js"
|
|
10
|
+
import { useResolveButtonType } from "../hooks/use-resolve-button-type.svelte.js"
|
|
11
|
+
import { useFloatingReference, useFloatingReferenceProps } from "../internal/floating.svelte.js"
|
|
12
|
+
import { stateFromSlot } from "../utils/state.js"
|
|
13
|
+
import type { Snippet } from "svelte"
|
|
14
|
+
import { useLabelledBy } from "../label/context.svelte.js"
|
|
15
|
+
import { useDescribedBy } from "../description/context.svelte.js"
|
|
16
|
+
import { useHover } from "../hooks/use-hover.svelte.js"
|
|
17
|
+
import { mergeProps } from "../utils/render.js"
|
|
18
|
+
import ElementOrComponent from "../utils/ElementOrComponent.svelte"
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} = $props();
|
|
30
|
-
const { setReference } = useFloatingReference();
|
|
31
|
-
const { getReferenceProps: getFloatingReferenceProps } = useFloatingReferenceProps();
|
|
32
|
-
$effect(() => {
|
|
33
|
-
data.buttonElement = ref || null;
|
|
34
|
-
setReference(ref);
|
|
35
|
-
});
|
|
36
|
-
const disabled = $derived(data.disabled || ownDisabled);
|
|
37
|
-
const handleKeyDown = (event) => {
|
|
38
|
-
switch (event.key) {
|
|
39
|
-
case "Enter":
|
|
40
|
-
if (event.currentTarget) attemptSubmit(event.currentTarget);
|
|
41
|
-
break;
|
|
42
|
-
case " ":
|
|
43
|
-
case "ArrowDown":
|
|
44
|
-
event.preventDefault();
|
|
45
|
-
actions.openListbox();
|
|
46
|
-
if (!data.value) actions.goToOption(Focus.First);
|
|
47
|
-
break;
|
|
48
|
-
case "ArrowUp":
|
|
49
|
-
event.preventDefault();
|
|
50
|
-
actions.openListbox();
|
|
51
|
-
if (!data.value) actions.goToOption(Focus.Last);
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const handleKeyUp = (event) => {
|
|
56
|
-
switch (event.key) {
|
|
57
|
-
case " ":
|
|
58
|
-
event.preventDefault();
|
|
59
|
-
break;
|
|
20
|
+
const DEFAULT_BUTTON_TAG = "button" as const
|
|
21
|
+
type ButtonRenderPropArg = {
|
|
22
|
+
disabled: boolean
|
|
23
|
+
invalid: boolean
|
|
24
|
+
hover: boolean
|
|
25
|
+
focus: boolean
|
|
26
|
+
autofocus: boolean
|
|
27
|
+
open: boolean
|
|
28
|
+
active: boolean
|
|
29
|
+
value: any
|
|
60
30
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
71
|
-
const handleKeyPress = (event) => event.preventDefault();
|
|
72
|
-
const labelledBy = useLabelledBy();
|
|
73
|
-
const describedBy = useDescribedBy();
|
|
74
|
-
const { isHovered: hover, hoverProps } = $derived(
|
|
75
|
-
useHover({
|
|
76
|
-
get disabled() {
|
|
77
|
-
return disabled;
|
|
31
|
+
type ButtonPropsWeControl = "aria-controls" | "aria-expanded" | "aria-haspopup" | "aria-labelledby" | "disabled"
|
|
32
|
+
|
|
33
|
+
export type ListboxButtonProps<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG> = Props<
|
|
34
|
+
TTag,
|
|
35
|
+
ButtonRenderPropArg,
|
|
36
|
+
ButtonPropsWeControl,
|
|
37
|
+
{
|
|
38
|
+
autofocus?: boolean
|
|
39
|
+
disabled?: boolean
|
|
78
40
|
}
|
|
41
|
+
>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<script lang="ts" generics="TTag extends ElementType = typeof DEFAULT_BUTTON_TAG">
|
|
45
|
+
const data = useData("ListboxButton")
|
|
46
|
+
const actions = useActions("ListboxButton")
|
|
47
|
+
|
|
48
|
+
const internalId = useId()
|
|
49
|
+
const providedId = useProvidedId()
|
|
50
|
+
let {
|
|
51
|
+
ref = $bindable(),
|
|
52
|
+
id = (providedId || `headlessui-listbox-button-${internalId}`) as PropsOf<TTag>["id"],
|
|
53
|
+
disabled: ownDisabled = false,
|
|
54
|
+
autofocus = false,
|
|
55
|
+
...theirProps
|
|
56
|
+
}: { as?: TTag } & ListboxButtonProps<TTag> = $props()
|
|
57
|
+
const { setReference } = useFloatingReference()
|
|
58
|
+
const { getReferenceProps: getFloatingReferenceProps } = useFloatingReferenceProps()
|
|
59
|
+
$effect(() => {
|
|
60
|
+
data.buttonElement = ref || null
|
|
61
|
+
setReference(ref)
|
|
79
62
|
})
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
63
|
+
|
|
64
|
+
const disabled = $derived(data.disabled || ownDisabled)
|
|
65
|
+
|
|
66
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
67
|
+
switch (event.key) {
|
|
68
|
+
// Ref: https://www.w3.org/WAI/ARIA/apg/patterns/menubutton/#keyboard-interaction-13
|
|
69
|
+
|
|
70
|
+
case "Enter":
|
|
71
|
+
if (event.currentTarget) attemptSubmit(event.currentTarget as HTMLElement)
|
|
72
|
+
break
|
|
73
|
+
|
|
74
|
+
case " ":
|
|
75
|
+
case "ArrowDown":
|
|
76
|
+
event.preventDefault()
|
|
77
|
+
actions.openListbox()
|
|
78
|
+
if (!data.value) actions.goToOption(Focus.First)
|
|
79
|
+
break
|
|
80
|
+
|
|
81
|
+
case "ArrowUp":
|
|
82
|
+
event.preventDefault()
|
|
83
|
+
actions.openListbox()
|
|
84
|
+
if (!data.value) actions.goToOption(Focus.Last)
|
|
85
|
+
break
|
|
85
86
|
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const handleKeyUp = (event: KeyboardEvent) => {
|
|
90
|
+
switch (event.key) {
|
|
91
|
+
case " ":
|
|
92
|
+
// Required for firefox, event.preventDefault() in handleKeyDown for
|
|
93
|
+
// the Space key doesn't cancel the handleKeyUp, which in turn
|
|
94
|
+
// triggers a *click*.
|
|
95
|
+
event.preventDefault()
|
|
96
|
+
break
|
|
92
97
|
}
|
|
93
|
-
})
|
|
94
|
-
);
|
|
95
|
-
const slot = $derived({
|
|
96
|
-
open: data.listboxState === ListboxStates.Open,
|
|
97
|
-
active: active || data.listboxState === ListboxStates.Open,
|
|
98
|
-
disabled,
|
|
99
|
-
invalid: data.invalid,
|
|
100
|
-
value: data.value,
|
|
101
|
-
hover,
|
|
102
|
-
focus,
|
|
103
|
-
autofocus: autofocus ?? false
|
|
104
|
-
});
|
|
105
|
-
const buttonType = useResolveButtonType({
|
|
106
|
-
get props() {
|
|
107
|
-
return { type: theirProps.type, as: theirProps.as };
|
|
108
|
-
},
|
|
109
|
-
get ref() {
|
|
110
|
-
return { current: data.buttonElement };
|
|
111
98
|
}
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
99
|
+
|
|
100
|
+
const handleClick = (event: MouseEvent) => {
|
|
101
|
+
//if (isDisabledReactIssue7711(event.currentTarget)) return event.preventDefault()
|
|
102
|
+
if (data.listboxState === ListboxStates.Open) {
|
|
103
|
+
actions.closeListbox()
|
|
104
|
+
data.buttonElement?.focus({ preventScroll: true })
|
|
105
|
+
} else {
|
|
106
|
+
event.preventDefault()
|
|
107
|
+
actions.openListbox()
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// This is needed so that we can "cancel" the click event when we use the `Enter` key on a button.
|
|
112
|
+
const handleKeyPress = (event: KeyboardEvent) => event.preventDefault()
|
|
113
|
+
|
|
114
|
+
const labelledBy = useLabelledBy()
|
|
115
|
+
const describedBy = useDescribedBy()
|
|
116
|
+
|
|
117
|
+
const { isHovered: hover, hoverProps } = $derived(
|
|
118
|
+
useHover({
|
|
119
|
+
get disabled() {
|
|
120
|
+
return disabled
|
|
121
|
+
},
|
|
122
|
+
})
|
|
123
|
+
)
|
|
124
|
+
const { pressed: active, pressProps } = $derived(
|
|
125
|
+
useActivePress({
|
|
126
|
+
get disabled() {
|
|
127
|
+
return disabled
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
)
|
|
131
|
+
const { isFocusVisible: focus, focusProps } = $derived(
|
|
132
|
+
useFocusRing({
|
|
133
|
+
get autofocus() {
|
|
134
|
+
return autofocus
|
|
135
|
+
},
|
|
136
|
+
})
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
const slot = $derived({
|
|
140
|
+
open: data.listboxState === ListboxStates.Open,
|
|
141
|
+
active: active || data.listboxState === ListboxStates.Open,
|
|
142
|
+
disabled,
|
|
143
|
+
invalid: data.invalid,
|
|
144
|
+
value: data.value,
|
|
145
|
+
hover,
|
|
146
|
+
focus,
|
|
147
|
+
autofocus: autofocus ?? false,
|
|
148
|
+
} satisfies ButtonRenderPropArg)
|
|
149
|
+
|
|
150
|
+
const buttonType = useResolveButtonType({
|
|
151
|
+
get props() {
|
|
152
|
+
return { type: theirProps.type, as: theirProps.as }
|
|
153
|
+
},
|
|
154
|
+
get ref() {
|
|
155
|
+
return { current: data.buttonElement }
|
|
130
156
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
const ourProps = $derived(
|
|
160
|
+
mergeProps(
|
|
161
|
+
{
|
|
162
|
+
...getFloatingReferenceProps(),
|
|
163
|
+
id,
|
|
164
|
+
type: buttonType.type,
|
|
165
|
+
"aria-haspopup": "listbox",
|
|
166
|
+
"aria-controls": data.optionsElement?.id,
|
|
167
|
+
"aria-expanded": data.listboxState === ListboxStates.Open,
|
|
168
|
+
"aria-labelledby": labelledBy.value,
|
|
169
|
+
"aria-describedby": describedBy.value,
|
|
170
|
+
disabled: disabled || undefined,
|
|
171
|
+
autofocus,
|
|
172
|
+
onkeydown: handleKeyDown,
|
|
173
|
+
onkeyup: handleKeyUp,
|
|
174
|
+
onkeypress: handleKeyPress,
|
|
175
|
+
onclick: handleClick,
|
|
176
|
+
},
|
|
177
|
+
focusProps,
|
|
178
|
+
hoverProps,
|
|
179
|
+
pressProps,
|
|
180
|
+
stateFromSlot(slot)
|
|
181
|
+
)
|
|
135
182
|
)
|
|
136
|
-
);
|
|
137
183
|
</script>
|
|
138
184
|
|
|
139
185
|
<ElementOrComponent {ourProps} {theirProps} {slot} defaultTag={DEFAULT_BUTTON_TAG} name="ListboxButton" bind:ref />
|
|
@@ -16,16 +16,17 @@ export type ListboxButtonProps<TTag extends ElementType = typeof DEFAULT_BUTTON_
|
|
|
16
16
|
autofocus?: boolean;
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
}>;
|
|
19
|
-
export type ListboxButtonChildren = Snippet<[ButtonRenderPropArg]>;
|
|
20
19
|
declare class __sveltets_Render<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG> {
|
|
21
20
|
props(): {
|
|
22
21
|
as?: TTag | undefined;
|
|
23
|
-
} & (Exclude<keyof PropsOf<TTag>, ("as" | "children" | "
|
|
24
|
-
children?: Snippet<[
|
|
22
|
+
} & (Exclude<keyof PropsOf<TTag>, ("slot" | "as" | "children" | "class" | "ref") | "autofocus" | ButtonPropsWeControl> extends infer T extends keyof PropsOf<TTag> ? { [P in T]: PropsOf<TTag>[P]; } : never) & {
|
|
23
|
+
children?: Snippet<[{
|
|
24
|
+
slot: ButtonRenderPropArg;
|
|
25
|
+
props: Record<string, any>;
|
|
26
|
+
}]> | undefined;
|
|
27
|
+
class?: string | ((bag: ButtonRenderPropArg) => string) | null | undefined;
|
|
25
28
|
ref?: HTMLElement;
|
|
26
|
-
} &
|
|
27
|
-
class?: PropsOf<TTag>["class"] | ((bag: ButtonRenderPropArg) => string) | undefined;
|
|
28
|
-
} : {}) & {
|
|
29
|
+
} & {
|
|
29
30
|
autofocus?: boolean;
|
|
30
31
|
disabled?: boolean;
|
|
31
32
|
};
|