@pzerelles/headlessui-svelte 2.1.2-next.33 → 2.1.2-next.35
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 +9 -11
- package/dist/button/Button.svelte.d.ts +4 -3
- package/dist/button/index.d.ts +1 -1
- package/dist/button/index.js +1 -1
- package/dist/checkbox/Checkbox.svelte +16 -14
- package/dist/checkbox/Checkbox.svelte.d.ts +4 -3
- package/dist/checkbox/index.d.ts +1 -1
- package/dist/checkbox/index.js +1 -1
- package/dist/close-button/index.d.ts +1 -0
- package/dist/close-button/index.js +1 -0
- package/dist/data-interactive/DataInteractive.svelte +1 -1
- package/dist/data-interactive/DataInteractive.svelte.d.ts +1 -1
- package/dist/data-interactive/index.d.ts +1 -1
- package/dist/data-interactive/index.js +1 -1
- package/dist/description/Description.svelte +6 -8
- package/dist/description/Description.svelte.d.ts +3 -2
- package/dist/description/index.d.ts +1 -1
- package/dist/dialog/Dialog.svelte +13 -16
- package/dist/dialog/Dialog.svelte.d.ts +3 -2
- package/dist/dialog/DialogBackdrop.svelte +4 -7
- package/dist/dialog/DialogBackdrop.svelte.d.ts +4 -3
- package/dist/dialog/DialogPanel.svelte +8 -11
- package/dist/dialog/DialogPanel.svelte.d.ts +4 -3
- package/dist/dialog/DialogTitle.svelte +4 -7
- package/dist/dialog/DialogTitle.svelte.d.ts +4 -3
- package/dist/dialog/context.svelte.js +1 -1
- package/dist/dialog/index.d.ts +4 -4
- package/dist/dialog/index.js +4 -4
- package/dist/field/Field.svelte +6 -10
- package/dist/field/Field.svelte.d.ts +3 -3
- package/dist/field/index.d.ts +1 -1
- package/dist/fieldset/Fieldset.svelte +6 -9
- package/dist/fieldset/Fieldset.svelte.d.ts +3 -3
- package/dist/fieldset/index.d.ts +1 -1
- package/dist/focus-trap/FocusTrap.svelte +12 -15
- package/dist/focus-trap/FocusTrap.svelte.d.ts +3 -3
- package/dist/input/Input.svelte +11 -13
- package/dist/input/Input.svelte.d.ts +4 -3
- package/dist/input/index.d.ts +1 -1
- package/dist/input/index.js +1 -1
- package/dist/internal/Hidden.svelte +1 -1
- package/dist/internal/Hidden.svelte.d.ts +1 -1
- package/dist/label/Label.svelte +8 -10
- package/dist/label/Label.svelte.d.ts +3 -2
- package/dist/label/index.d.ts +1 -1
- package/dist/legend/Legend.svelte +6 -8
- package/dist/legend/Legend.svelte.d.ts +3 -2
- package/dist/listbox/Listbox.svelte +17 -16
- package/dist/listbox/Listbox.svelte.d.ts +4 -3
- package/dist/listbox/ListboxButton.svelte +9 -12
- package/dist/listbox/ListboxButton.svelte.d.ts +4 -3
- package/dist/listbox/ListboxOption.svelte +9 -7
- package/dist/listbox/ListboxOption.svelte.d.ts +4 -3
- package/dist/listbox/ListboxOptions.svelte +11 -14
- package/dist/listbox/ListboxOptions.svelte.d.ts +4 -3
- package/dist/listbox/ListboxSelectedOption.svelte +8 -6
- package/dist/listbox/ListboxSelectedOption.svelte.d.ts +4 -3
- package/dist/listbox/index.d.ts +5 -5
- package/dist/listbox/index.js +5 -5
- package/dist/menu/Menu.svelte +6 -7
- package/dist/menu/Menu.svelte.d.ts +4 -3
- package/dist/menu/MenuButton.svelte +10 -12
- package/dist/menu/MenuButton.svelte.d.ts +4 -3
- package/dist/menu/MenuHeading.svelte +7 -10
- package/dist/menu/MenuHeading.svelte.d.ts +3 -3
- package/dist/menu/MenuItem.svelte +8 -10
- package/dist/menu/MenuItem.svelte.d.ts +4 -3
- package/dist/menu/MenuItems.svelte +11 -13
- package/dist/menu/MenuItems.svelte.d.ts +4 -3
- package/dist/menu/MenuSection.svelte +6 -8
- package/dist/menu/MenuSection.svelte.d.ts +3 -3
- package/dist/menu/MenuSeparator.svelte +6 -8
- package/dist/menu/MenuSeparator.svelte.d.ts +3 -3
- package/dist/menu/index.d.ts +7 -7
- package/dist/menu/index.js +3 -3
- package/dist/popover/Popover.svelte +7 -9
- package/dist/popover/Popover.svelte.d.ts +4 -3
- package/dist/popover/PopoverBackdrop.svelte +8 -10
- package/dist/popover/PopoverBackdrop.svelte.d.ts +4 -3
- package/dist/popover/PopoverButton.svelte +8 -10
- package/dist/popover/PopoverButton.svelte.d.ts +3 -2
- package/dist/popover/PopoverGroup.svelte +6 -11
- package/dist/popover/PopoverGroup.svelte.d.ts +3 -3
- package/dist/popover/PopoverPanel.svelte +16 -18
- package/dist/popover/PopoverPanel.svelte.d.ts +4 -3
- package/dist/popover/index.d.ts +5 -5
- package/dist/popover/index.js +3 -3
- package/dist/portal/InternalPortal.svelte +1 -2
- package/dist/portal/InternalPortal.svelte.d.ts +1 -1
- package/dist/portal/PortalGroup.svelte +1 -1
- package/dist/portal/PortalGroup.svelte.d.ts +1 -1
- package/dist/select/Select.svelte +10 -12
- package/dist/select/Select.svelte.d.ts +4 -3
- package/dist/select/index.d.ts +1 -1
- package/dist/select/index.js +1 -1
- package/dist/switch/Switch.svelte +16 -18
- package/dist/switch/Switch.svelte.d.ts +4 -3
- package/dist/switch/index.d.ts +1 -1
- package/dist/switch/index.js +1 -1
- package/dist/tabs/Tab.svelte +9 -11
- package/dist/tabs/Tab.svelte.d.ts +4 -3
- package/dist/tabs/TabGroup.svelte +11 -13
- package/dist/tabs/TabGroup.svelte.d.ts +4 -3
- package/dist/tabs/TabList.svelte +6 -8
- package/dist/tabs/TabList.svelte.d.ts +4 -3
- package/dist/tabs/TabPanel.svelte +8 -7
- package/dist/tabs/TabPanel.svelte.d.ts +4 -3
- package/dist/tabs/TabPanels.svelte +4 -2
- package/dist/tabs/TabPanels.svelte.d.ts +4 -3
- package/dist/tabs/index.d.ts +5 -5
- package/dist/tabs/index.js +4 -4
- package/dist/textarea/Textarea.svelte +11 -10
- package/dist/textarea/Textarea.svelte.d.ts +4 -3
- package/dist/textarea/index.d.ts +1 -1
- package/dist/textarea/index.js +1 -1
- package/dist/transition/Transition.svelte +10 -1
- package/dist/transition/Transition.svelte.d.ts +5 -1
- package/dist/transition/TransitionChild.svelte +5 -3
- package/dist/transition/TransitionChild.svelte.d.ts +3 -2
- package/dist/transition/index.d.ts +2 -2
- package/dist/transition/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import type { Props } from "../utils/types.js";
|
|
2
2
|
declare const DEFAULT_INPUT_TAG: "input";
|
|
3
|
-
type InputRenderPropArg = {
|
|
3
|
+
export type InputRenderPropArg = {
|
|
4
4
|
disabled: boolean;
|
|
5
5
|
hover: boolean;
|
|
6
6
|
focus: boolean;
|
|
7
7
|
autofocus: boolean;
|
|
8
8
|
invalid: boolean;
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
10
|
+
export type InputOwnProps<TValue = string> = {
|
|
11
11
|
element?: HTMLElement;
|
|
12
12
|
id?: string;
|
|
13
13
|
value?: TValue;
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
invalid?: boolean;
|
|
16
16
|
autofocus?: boolean;
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
|
+
export type InputProps<TValue = string> = Props<typeof DEFAULT_INPUT_TAG, InputRenderPropArg, InputOwnProps<TValue>>;
|
|
18
19
|
declare class __sveltets_Render<TValue = string> {
|
|
19
20
|
props(): InputProps<TValue>;
|
|
20
21
|
events(): {};
|
package/dist/input/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Input, type InputProps } from "./Input.svelte";
|
|
1
|
+
export { default as Input, type InputProps, type InputRenderPropArg as InputSlot, type InputOwnProps, } from "./Input.svelte";
|
package/dist/input/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Input } from "./Input.svelte";
|
|
1
|
+
export { default as Input, } from "./Input.svelte";
|
|
@@ -2,7 +2,7 @@ import type { Props } from "../utils/types.js";
|
|
|
2
2
|
import { HiddenFeatures } from "./HiddenFeatures.js";
|
|
3
3
|
export * from "./HiddenFeatures.js";
|
|
4
4
|
declare const DEFAULT_VISUALLY_HIDDEN_TAG: "span";
|
|
5
|
-
type HiddenRenderPropArg = {};
|
|
5
|
+
export type HiddenRenderPropArg = {};
|
|
6
6
|
export type HiddenProps = Props<typeof DEFAULT_VISUALLY_HIDDEN_TAG, HiddenRenderPropArg, {
|
|
7
7
|
element?: HTMLElement;
|
|
8
8
|
features?: HiddenFeatures;
|
package/dist/label/Label.svelte
CHANGED
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
const DEFAULT_LABEL_TAG = "label" as const
|
|
5
5
|
|
|
6
|
-
export type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
>
|
|
6
|
+
export type LabelOwnProps = {
|
|
7
|
+
element?: HTMLElement
|
|
8
|
+
id?: string
|
|
9
|
+
passive?: boolean
|
|
10
|
+
htmlFor?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type LabelProps = Props<typeof DEFAULT_LABEL_TAG, {}, LabelOwnProps>
|
|
16
14
|
</script>
|
|
17
15
|
|
|
18
16
|
<script lang="ts">
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Props } from "../utils/types.js";
|
|
2
2
|
declare const DEFAULT_LABEL_TAG: "label";
|
|
3
|
-
export type
|
|
3
|
+
export type LabelOwnProps = {
|
|
4
4
|
element?: HTMLElement;
|
|
5
5
|
id?: string;
|
|
6
6
|
passive?: boolean;
|
|
7
7
|
htmlFor?: string;
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
|
+
export type LabelProps = Props<typeof DEFAULT_LABEL_TAG, {}, LabelOwnProps>;
|
|
9
10
|
declare const Label: import("svelte").Component<LabelProps, {}, "element">;
|
|
10
11
|
export default Label;
|
package/dist/label/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Label, type LabelProps } from "./Label.svelte";
|
|
1
|
+
export { default as Label, type LabelProps, type LabelOwnProps } from "./Label.svelte";
|
|
@@ -4,14 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
const DEFAULT_LEGEND_TAG = "div" as const
|
|
6
6
|
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
>
|
|
7
|
+
export type LegendOwnProps = {
|
|
8
|
+
element?: HTMLElement
|
|
9
|
+
class?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type LegendProps = Props<typeof DEFAULT_LEGEND_TAG, {}, LegendOwnProps>
|
|
15
13
|
</script>
|
|
16
14
|
|
|
17
15
|
<script lang="ts">
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Props } from "../utils/types.js";
|
|
2
2
|
declare const DEFAULT_LEGEND_TAG: "div";
|
|
3
|
-
export type
|
|
3
|
+
export type LegendOwnProps = {
|
|
4
4
|
element?: HTMLElement;
|
|
5
5
|
class?: string;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
|
+
export type LegendProps = Props<typeof DEFAULT_LEGEND_TAG, {}, LegendOwnProps>;
|
|
7
8
|
declare const Legend: import("svelte").Component<LegendProps, {}, "">;
|
|
8
9
|
export default Legend;
|
|
@@ -9,30 +9,31 @@
|
|
|
9
9
|
import { setContext } from "svelte"
|
|
10
10
|
import { ActivationTrigger, ListboxStates, ValueMode } from "./context.svelte.js"
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
type ListboxRenderPropArg<T> = {
|
|
12
|
+
export type ListboxRenderPropArg<T> = {
|
|
14
13
|
open: boolean
|
|
15
14
|
disabled: boolean
|
|
16
15
|
invalid: boolean
|
|
17
16
|
value: T
|
|
18
17
|
}
|
|
19
18
|
|
|
19
|
+
export type ListboxOwnProps<TType = string, TActualType = TType extends (infer U)[] ? U : TType> = {
|
|
20
|
+
value?: TType
|
|
21
|
+
defaultValue?: TType
|
|
22
|
+
onchange?: (value: TType) => void
|
|
23
|
+
by?: ByComparator<TActualType>
|
|
24
|
+
disabled?: boolean
|
|
25
|
+
invalid?: boolean
|
|
26
|
+
horizontal?: boolean
|
|
27
|
+
form?: string
|
|
28
|
+
name?: string
|
|
29
|
+
multiple?: boolean
|
|
30
|
+
closeOnSelect?: boolean
|
|
31
|
+
__demoMode?: boolean
|
|
32
|
+
}
|
|
33
|
+
|
|
20
34
|
export type ListboxProps<TType = string, TActualType = TType extends (infer U)[] ? U : TType> = PropsAsChild<
|
|
21
35
|
ListboxRenderPropArg<TType>,
|
|
22
|
-
|
|
23
|
-
value?: TType
|
|
24
|
-
defaultValue?: TType
|
|
25
|
-
onchange?: (value: TType) => void
|
|
26
|
-
by?: ByComparator<TActualType>
|
|
27
|
-
disabled?: boolean
|
|
28
|
-
invalid?: boolean
|
|
29
|
-
horizontal?: boolean
|
|
30
|
-
form?: string
|
|
31
|
-
name?: string
|
|
32
|
-
multiple?: boolean
|
|
33
|
-
closeOnSelect?: boolean
|
|
34
|
-
__demoMode?: boolean
|
|
35
|
-
}
|
|
36
|
+
ListboxOwnProps<TType, TActualType>
|
|
36
37
|
>
|
|
37
38
|
|
|
38
39
|
export * from "./context.svelte.js"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type ByComparator } from "../hooks/use-by-comparator.js";
|
|
2
2
|
import type { PropsAsChild } from "../utils/types.js";
|
|
3
|
-
type ListboxRenderPropArg<T> = {
|
|
3
|
+
export type ListboxRenderPropArg<T> = {
|
|
4
4
|
open: boolean;
|
|
5
5
|
disabled: boolean;
|
|
6
6
|
invalid: boolean;
|
|
7
7
|
value: T;
|
|
8
8
|
};
|
|
9
|
-
export type
|
|
9
|
+
export type ListboxOwnProps<TType = string, TActualType = TType extends (infer U)[] ? U : TType> = {
|
|
10
10
|
value?: TType;
|
|
11
11
|
defaultValue?: TType;
|
|
12
12
|
onchange?: (value: TType) => void;
|
|
@@ -19,7 +19,8 @@ export type ListboxProps<TType = string, TActualType = TType extends (infer U)[]
|
|
|
19
19
|
multiple?: boolean;
|
|
20
20
|
closeOnSelect?: boolean;
|
|
21
21
|
__demoMode?: boolean;
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
|
+
export type ListboxProps<TType = string, TActualType = TType extends (infer U)[] ? U : TType> = PropsAsChild<ListboxRenderPropArg<TType>, ListboxOwnProps<TType, TActualType>>;
|
|
23
24
|
export * from "./context.svelte.js";
|
|
24
25
|
declare class __sveltets_Render<TType = string, TActualType = TType extends (infer U)[] ? U : TType> {
|
|
25
26
|
props(): ListboxProps<TType, TActualType>;
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
import { useResolveButtonType } from "../hooks/use-resolve-button-type.svelte.js"
|
|
11
11
|
import { useFloatingReference, useFloatingReferenceProps } from "../internal/floating.svelte.js"
|
|
12
12
|
import { stateFromSlot } from "../utils/state.js"
|
|
13
|
-
import type { SvelteHTMLElements } from "svelte/elements"
|
|
14
13
|
import { useLabelledBy } from "../label/context.svelte.js"
|
|
15
14
|
import { useDescribedBy } from "../description/context.svelte.js"
|
|
16
15
|
import { useHover } from "../hooks/use-hover.svelte.js"
|
|
@@ -18,7 +17,7 @@
|
|
|
18
17
|
import ElementOrComponent from "../utils/ElementOrComponent.svelte"
|
|
19
18
|
|
|
20
19
|
const DEFAULT_BUTTON_TAG = "button" as const
|
|
21
|
-
type ButtonRenderPropArg = {
|
|
20
|
+
export type ButtonRenderPropArg = {
|
|
22
21
|
disabled: boolean
|
|
23
22
|
invalid: boolean
|
|
24
23
|
hover: boolean
|
|
@@ -30,16 +29,14 @@
|
|
|
30
29
|
}
|
|
31
30
|
type ButtonPropsWeControl = "aria-controls" | "aria-expanded" | "aria-haspopup" | "aria-labelledby" | "disabled"
|
|
32
31
|
|
|
33
|
-
export type
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
>
|
|
32
|
+
export type ListboxButtonOwnProps = {
|
|
33
|
+
element?: HTMLElement
|
|
34
|
+
id?: string
|
|
35
|
+
autofocus?: boolean
|
|
36
|
+
disabled?: boolean
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type ListboxButtonProps = Props<typeof DEFAULT_BUTTON_TAG, ButtonRenderPropArg, ListboxButtonOwnProps>
|
|
43
40
|
</script>
|
|
44
41
|
|
|
45
42
|
<script lang="ts">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Props } from "../utils/types.js";
|
|
2
2
|
declare const DEFAULT_BUTTON_TAG: "button";
|
|
3
|
-
type ButtonRenderPropArg = {
|
|
3
|
+
export type ButtonRenderPropArg = {
|
|
4
4
|
disabled: boolean;
|
|
5
5
|
invalid: boolean;
|
|
6
6
|
hover: boolean;
|
|
@@ -10,11 +10,12 @@ type ButtonRenderPropArg = {
|
|
|
10
10
|
active: boolean;
|
|
11
11
|
value: any;
|
|
12
12
|
};
|
|
13
|
-
export type
|
|
13
|
+
export type ListboxButtonOwnProps = {
|
|
14
14
|
element?: HTMLElement;
|
|
15
15
|
id?: string;
|
|
16
16
|
autofocus?: boolean;
|
|
17
17
|
disabled?: boolean;
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
|
+
export type ListboxButtonProps = Props<typeof DEFAULT_BUTTON_TAG, ButtonRenderPropArg, ListboxButtonOwnProps>;
|
|
19
20
|
declare const ListboxButton: import("svelte").Component<ListboxButtonProps, {}, "element">;
|
|
20
21
|
export default ListboxButton;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { Props } from "../utils/types.js"
|
|
3
3
|
|
|
4
4
|
const DEFAULT_OPTION_TAG = "div" as const
|
|
5
|
-
type OptionRenderPropArg = {
|
|
5
|
+
export type OptionRenderPropArg = {
|
|
6
6
|
/** @deprecated use `focus` instead */
|
|
7
7
|
active: boolean
|
|
8
8
|
focus: boolean
|
|
@@ -13,15 +13,17 @@
|
|
|
13
13
|
}
|
|
14
14
|
type OptionPropsWeControl = "aria-disabled" | "aria-selected" | "role" | "tabIndex"
|
|
15
15
|
|
|
16
|
+
export type ListboxOptionOwnProps<TType = string> = {
|
|
17
|
+
element?: HTMLElement
|
|
18
|
+
id?: string
|
|
19
|
+
disabled?: boolean
|
|
20
|
+
value: TType
|
|
21
|
+
}
|
|
22
|
+
|
|
16
23
|
export type ListboxOptionProps<TType = string> = Props<
|
|
17
24
|
typeof DEFAULT_OPTION_TAG,
|
|
18
25
|
OptionRenderPropArg,
|
|
19
|
-
|
|
20
|
-
element?: HTMLElement
|
|
21
|
-
id?: string
|
|
22
|
-
disabled?: boolean
|
|
23
|
-
value: TType
|
|
24
|
-
}
|
|
26
|
+
ListboxOptionOwnProps<TType>
|
|
25
27
|
>
|
|
26
28
|
</script>
|
|
27
29
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Props } from "../utils/types.js";
|
|
2
2
|
declare const DEFAULT_OPTION_TAG: "div";
|
|
3
|
-
type OptionRenderPropArg = {
|
|
3
|
+
export type OptionRenderPropArg = {
|
|
4
4
|
/** @deprecated use `focus` instead */
|
|
5
5
|
active: boolean;
|
|
6
6
|
focus: boolean;
|
|
@@ -8,12 +8,13 @@ type OptionRenderPropArg = {
|
|
|
8
8
|
disabled: boolean;
|
|
9
9
|
selectedOption: boolean;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
11
|
+
export type ListboxOptionOwnProps<TType = string> = {
|
|
12
12
|
element?: HTMLElement;
|
|
13
13
|
id?: string;
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
value: TType;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
|
+
export type ListboxOptionProps<TType = string> = Props<typeof DEFAULT_OPTION_TAG, OptionRenderPropArg, ListboxOptionOwnProps<TType>>;
|
|
17
18
|
declare class __sveltets_Render<TType> {
|
|
18
19
|
props(): ListboxOptionProps<TType>;
|
|
19
20
|
events(): {};
|
|
@@ -7,11 +7,10 @@
|
|
|
7
7
|
useResolvedAnchor,
|
|
8
8
|
type AnchorPropsWithSelection,
|
|
9
9
|
} from "../internal/floating.svelte.js"
|
|
10
|
-
import type { SvelteHTMLElements } from "svelte/elements"
|
|
11
10
|
|
|
12
11
|
const DEFAULT_OPTIONS_TAG = "div" as const
|
|
13
12
|
|
|
14
|
-
type OptionsRenderPropArg = {
|
|
13
|
+
export type OptionsRenderPropArg = {
|
|
15
14
|
open: boolean
|
|
16
15
|
}
|
|
17
16
|
type OptionsPropsWeControl =
|
|
@@ -24,18 +23,16 @@
|
|
|
24
23
|
|
|
25
24
|
let OptionsRenderFeatures = RenderFeatures.RenderStrategy | RenderFeatures.Static
|
|
26
25
|
|
|
27
|
-
export type
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} & PropsForFeatures<typeof OptionsRenderFeatures>
|
|
38
|
-
>
|
|
26
|
+
export type ListboxOptionsOwnProps = {
|
|
27
|
+
element?: HTMLElement
|
|
28
|
+
id?: string
|
|
29
|
+
anchor?: AnchorPropsWithSelection
|
|
30
|
+
portal?: boolean
|
|
31
|
+
modal?: boolean
|
|
32
|
+
transition?: boolean
|
|
33
|
+
} & PropsForFeatures<typeof OptionsRenderFeatures>
|
|
34
|
+
|
|
35
|
+
export type ListboxOptionsProps = Props<typeof DEFAULT_OPTIONS_TAG, OptionsRenderPropArg, ListboxOptionsOwnProps>
|
|
39
36
|
</script>
|
|
40
37
|
|
|
41
38
|
<script lang="ts">
|
|
@@ -2,17 +2,18 @@ import type { Props } from "../utils/types.js";
|
|
|
2
2
|
import { type PropsForFeatures } from "../utils/render.js";
|
|
3
3
|
import { type AnchorPropsWithSelection } from "../internal/floating.svelte.js";
|
|
4
4
|
declare const DEFAULT_OPTIONS_TAG: "div";
|
|
5
|
-
type OptionsRenderPropArg = {
|
|
5
|
+
export type OptionsRenderPropArg = {
|
|
6
6
|
open: boolean;
|
|
7
7
|
};
|
|
8
8
|
declare let OptionsRenderFeatures: number;
|
|
9
|
-
export type
|
|
9
|
+
export type ListboxOptionsOwnProps = {
|
|
10
10
|
element?: HTMLElement;
|
|
11
11
|
id?: string;
|
|
12
12
|
anchor?: AnchorPropsWithSelection;
|
|
13
13
|
portal?: boolean;
|
|
14
14
|
modal?: boolean;
|
|
15
15
|
transition?: boolean;
|
|
16
|
-
} & PropsForFeatures<typeof OptionsRenderFeatures
|
|
16
|
+
} & PropsForFeatures<typeof OptionsRenderFeatures>;
|
|
17
|
+
export type ListboxOptionsProps = Props<typeof DEFAULT_OPTIONS_TAG, OptionsRenderPropArg, ListboxOptionsOwnProps>;
|
|
17
18
|
declare const ListboxOptions: import("svelte").Component<ListboxOptionsProps, {}, "element">;
|
|
18
19
|
export default ListboxOptions;
|
|
@@ -3,19 +3,21 @@
|
|
|
3
3
|
import type { Snippet } from "svelte"
|
|
4
4
|
|
|
5
5
|
const DEFAULT_SELECTED_OPTION_TAG = "span"
|
|
6
|
-
type SelectedOptionRenderPropArg = {
|
|
6
|
+
export type SelectedOptionRenderPropArg = {
|
|
7
7
|
option: Snippet
|
|
8
8
|
}
|
|
9
9
|
type SelectedOptionPropsWeControl = never
|
|
10
10
|
|
|
11
|
+
export type ListboxSelectedOptionOwnProps = {
|
|
12
|
+
element?: HTMLElement
|
|
13
|
+
options: Snippet
|
|
14
|
+
placeholder?: Snippet
|
|
15
|
+
}
|
|
16
|
+
|
|
11
17
|
export type ListboxSelectedOptionProps = Props<
|
|
12
18
|
typeof DEFAULT_SELECTED_OPTION_TAG,
|
|
13
19
|
SelectedOptionRenderPropArg,
|
|
14
|
-
|
|
15
|
-
element?: HTMLElement
|
|
16
|
-
options: Snippet
|
|
17
|
-
placeholder?: Snippet
|
|
18
|
-
}
|
|
20
|
+
ListboxSelectedOptionOwnProps
|
|
19
21
|
>
|
|
20
22
|
</script>
|
|
21
23
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { Props } from "../utils/types.js";
|
|
2
2
|
import type { Snippet } from "svelte";
|
|
3
3
|
declare const DEFAULT_SELECTED_OPTION_TAG = "span";
|
|
4
|
-
type SelectedOptionRenderPropArg = {
|
|
4
|
+
export type SelectedOptionRenderPropArg = {
|
|
5
5
|
option: Snippet;
|
|
6
6
|
};
|
|
7
|
-
export type
|
|
7
|
+
export type ListboxSelectedOptionOwnProps = {
|
|
8
8
|
element?: HTMLElement;
|
|
9
9
|
options: Snippet;
|
|
10
10
|
placeholder?: Snippet;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
|
+
export type ListboxSelectedOptionProps = Props<typeof DEFAULT_SELECTED_OPTION_TAG, SelectedOptionRenderPropArg, ListboxSelectedOptionOwnProps>;
|
|
12
13
|
declare const ListboxSelectedOption: import("svelte").Component<ListboxSelectedOptionProps, {}, "element">;
|
|
13
14
|
export default ListboxSelectedOption;
|
package/dist/listbox/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default as Listbox, type ListboxProps } from "./Listbox.svelte";
|
|
2
|
-
export { default as ListboxButton, type ListboxButtonProps } from "./ListboxButton.svelte";
|
|
3
|
-
export { default as ListboxOption, type ListboxOptionProps } from "./ListboxOption.svelte";
|
|
4
|
-
export { default as ListboxOptions, type ListboxOptionsProps } from "./ListboxOptions.svelte";
|
|
5
|
-
export { default as ListboxSelectedOption, type ListboxSelectedOptionProps } from "./ListboxSelectedOption.svelte";
|
|
1
|
+
export { default as Listbox, type ListboxProps, type ListboxRenderPropArg as ListboxSlot, type ListboxOwnProps, } from "./Listbox.svelte";
|
|
2
|
+
export { default as ListboxButton, type ListboxButtonProps, type ButtonRenderPropArg as ListboxButtonSlot, type ListboxButtonOwnProps, } from "./ListboxButton.svelte";
|
|
3
|
+
export { default as ListboxOption, type ListboxOptionProps, type OptionRenderPropArg as ListboxOptionSlot, type ListboxOptionOwnProps, } from "./ListboxOption.svelte";
|
|
4
|
+
export { default as ListboxOptions, type ListboxOptionsProps, type OptionsRenderPropArg as ListboxOptionsSlot, type ListboxOptionsOwnProps, } from "./ListboxOptions.svelte";
|
|
5
|
+
export { default as ListboxSelectedOption, type ListboxSelectedOptionProps, type SelectedOptionRenderPropArg as ListboxSelectedOptionSlot, type ListboxSelectedOptionOwnProps, } from "./ListboxSelectedOption.svelte";
|
package/dist/listbox/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default as Listbox } from "./Listbox.svelte";
|
|
2
|
-
export { default as ListboxButton } from "./ListboxButton.svelte";
|
|
3
|
-
export { default as ListboxOption } from "./ListboxOption.svelte";
|
|
4
|
-
export { default as ListboxOptions } from "./ListboxOptions.svelte";
|
|
5
|
-
export { default as ListboxSelectedOption } from "./ListboxSelectedOption.svelte";
|
|
1
|
+
export { default as Listbox, } from "./Listbox.svelte";
|
|
2
|
+
export { default as ListboxButton, } from "./ListboxButton.svelte";
|
|
3
|
+
export { default as ListboxOption, } from "./ListboxOption.svelte";
|
|
4
|
+
export { default as ListboxOptions, } from "./ListboxOptions.svelte";
|
|
5
|
+
export { default as ListboxSelectedOption, } from "./ListboxSelectedOption.svelte";
|
package/dist/menu/Menu.svelte
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
import type { PropsAsChild } from "../utils/types.js"
|
|
3
3
|
|
|
4
4
|
let DEFAULT_MENU_TAG = "svelte:fragment"
|
|
5
|
-
type MenuRenderPropArg = {
|
|
5
|
+
export type MenuRenderPropArg = {
|
|
6
6
|
open: boolean
|
|
7
7
|
close: () => void
|
|
8
8
|
}
|
|
9
9
|
type MenuPropsWeControl = never
|
|
10
10
|
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
>
|
|
11
|
+
export type MenuOwnProps = {
|
|
12
|
+
__demoMode?: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type MenuProps = PropsAsChild<MenuRenderPropArg, MenuOwnProps>
|
|
17
16
|
</script>
|
|
18
17
|
|
|
19
18
|
<script lang="ts">
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { PropsAsChild } from "../utils/types.js";
|
|
2
|
-
type MenuRenderPropArg = {
|
|
2
|
+
export type MenuRenderPropArg = {
|
|
3
3
|
open: boolean;
|
|
4
4
|
close: () => void;
|
|
5
5
|
};
|
|
6
|
-
export type
|
|
6
|
+
export type MenuOwnProps = {
|
|
7
7
|
__demoMode?: boolean;
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
|
+
export type MenuProps = PropsAsChild<MenuRenderPropArg, MenuOwnProps>;
|
|
9
10
|
declare const Menu: import("svelte").Component<MenuProps, {}, "">;
|
|
10
11
|
export default Menu;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { Props } from "../utils/types.js"
|
|
4
4
|
|
|
5
5
|
const DEFAULT_BUTTON_TAG = "button" as const
|
|
6
|
-
type ButtonRenderPropArg = {
|
|
6
|
+
export type ButtonRenderPropArg = {
|
|
7
7
|
open: boolean
|
|
8
8
|
active: boolean
|
|
9
9
|
hover: boolean
|
|
@@ -13,17 +13,15 @@
|
|
|
13
13
|
}
|
|
14
14
|
type ButtonPropsWeControl = "aria-controls" | "aria-expanded" | "aria-haspopup"
|
|
15
15
|
|
|
16
|
-
export type
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
>
|
|
16
|
+
export type MenuButtonOwnProps = {
|
|
17
|
+
element?: HTMLElement
|
|
18
|
+
id?: string
|
|
19
|
+
disabled?: boolean
|
|
20
|
+
autofocus?: boolean
|
|
21
|
+
type?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type MenuButtonProps = Props<typeof DEFAULT_BUTTON_TAG, ButtonRenderPropArg, MenuButtonOwnProps>
|
|
27
25
|
</script>
|
|
28
26
|
|
|
29
27
|
<script lang="ts">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Props } from "../utils/types.js";
|
|
2
2
|
declare const DEFAULT_BUTTON_TAG: "button";
|
|
3
|
-
type ButtonRenderPropArg = {
|
|
3
|
+
export type ButtonRenderPropArg = {
|
|
4
4
|
open: boolean;
|
|
5
5
|
active: boolean;
|
|
6
6
|
hover: boolean;
|
|
@@ -8,12 +8,13 @@ type ButtonRenderPropArg = {
|
|
|
8
8
|
disabled: boolean;
|
|
9
9
|
autofocus: boolean;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
11
|
+
export type MenuButtonOwnProps = {
|
|
12
12
|
element?: HTMLElement;
|
|
13
13
|
id?: string;
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
autofocus?: boolean;
|
|
16
16
|
type?: string;
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
|
+
export type MenuButtonProps = Props<typeof DEFAULT_BUTTON_TAG, ButtonRenderPropArg, MenuButtonOwnProps>;
|
|
18
19
|
declare const MenuButton: import("svelte").Component<MenuButtonProps, {}, "element">;
|
|
19
20
|
export default MenuButton;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import { onMount } from "svelte"
|
|
3
|
-
import type { SvelteHTMLElements } from "svelte/elements"
|
|
4
3
|
import type { Props } from "../utils/types.js"
|
|
5
4
|
|
|
6
5
|
const DEFAULT_HEADING_TAG = "header" as const
|
|
7
|
-
|
|
6
|
+
|
|
8
7
|
type HeadingPropsWeControl = "role"
|
|
9
8
|
|
|
10
|
-
export type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
>
|
|
9
|
+
export type MenuHeadingOwnProps = {
|
|
10
|
+
element?: HTMLElement
|
|
11
|
+
id?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type MenuHeadingProps = Props<typeof DEFAULT_HEADING_TAG, {}, MenuHeadingOwnProps>
|
|
18
15
|
</script>
|
|
19
16
|
|
|
20
17
|
<script lang="ts">
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Props } from "../utils/types.js";
|
|
2
2
|
declare const DEFAULT_HEADING_TAG: "header";
|
|
3
|
-
type
|
|
4
|
-
export type MenuHeadingProps = Props<typeof DEFAULT_HEADING_TAG, HeadingRenderPropArg, {
|
|
3
|
+
export type MenuHeadingOwnProps = {
|
|
5
4
|
element?: HTMLElement;
|
|
6
5
|
id?: string;
|
|
7
|
-
}
|
|
6
|
+
};
|
|
7
|
+
export type MenuHeadingProps = Props<typeof DEFAULT_HEADING_TAG, {}, MenuHeadingOwnProps>;
|
|
8
8
|
declare const MenuHeading: import("svelte").Component<MenuHeadingProps, {}, "element">;
|
|
9
9
|
export default MenuHeading;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { onMount } from "svelte"
|
|
4
4
|
|
|
5
5
|
const DEFAULT_ITEM_TAG = "button" as const
|
|
6
|
-
type ItemRenderPropArg = {
|
|
6
|
+
export type ItemRenderPropArg = {
|
|
7
7
|
/** @deprecated use `focus` instead */
|
|
8
8
|
active: boolean
|
|
9
9
|
focus: boolean
|
|
@@ -13,15 +13,13 @@
|
|
|
13
13
|
}
|
|
14
14
|
type ItemPropsWeControl = "aria-describedby" | "aria-disabled" | "aria-labelledby" | "role" | "tabIndex"
|
|
15
15
|
|
|
16
|
-
export type
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
>
|
|
16
|
+
export type MenuItemOwnProps = {
|
|
17
|
+
element?: HTMLElement
|
|
18
|
+
id?: string
|
|
19
|
+
disabled?: boolean
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type MenuItemProps = Props<typeof DEFAULT_ITEM_TAG, ItemRenderPropArg, MenuItemOwnProps>
|
|
25
23
|
</script>
|
|
26
24
|
|
|
27
25
|
<script lang="ts">
|