@pzerelles/headlessui-svelte 2.1.2-next.30 → 2.1.2-next.31
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,5 +1,4 @@
|
|
|
1
1
|
import { useInteractions, type InnerProps, type UseFloatingReturn } from "../utils/floating-ui/svelte/index.js";
|
|
2
|
-
export { useFloatingProvider } from "./floating-provider.svelte.js";
|
|
3
2
|
export type Align = "start" | "end";
|
|
4
3
|
export type Placement = "top" | "right" | "bottom" | "left";
|
|
5
4
|
export type BaseAnchorProps = {
|
|
@@ -61,7 +60,7 @@ export declare function useFloatingReferenceProps(): {
|
|
|
61
60
|
readonly getReferenceProps: (userProps?: import("svelte/elements.js").HTMLAttributes<Element>) => Record<string, unknown>;
|
|
62
61
|
};
|
|
63
62
|
export declare function useFloatingPanelProps(): (userProps?: import("svelte/elements.js").HTMLAttributes<HTMLElement> | undefined) => Record<string, unknown> & {
|
|
64
|
-
"data-anchor": Placement | "
|
|
63
|
+
"data-anchor": Placement | "top end" | "top start" | "right end" | "right start" | "bottom end" | "bottom start" | "left end" | "left start" | "selection" | "selection end" | "selection start" | undefined;
|
|
65
64
|
};
|
|
66
65
|
export declare function useFloatingPanel(options?: {
|
|
67
66
|
placement: (AnchorPropsWithSelection & InternalFloatingPanelProps) | null;
|
|
@@ -76,7 +75,7 @@ export declare function useResolvedConfig(options: {
|
|
|
76
75
|
config: (Exclude<AnchorPropsWithSelection, boolean | string> & InternalFloatingPanelProps) | null;
|
|
77
76
|
element?: HTMLElement | null;
|
|
78
77
|
}): {
|
|
79
|
-
readonly to: Placement | "
|
|
78
|
+
readonly to: Placement | "top end" | "top start" | "right end" | "right start" | "bottom end" | "bottom start" | "left end" | "left start" | "selection" | "selection end" | "selection start" | undefined;
|
|
80
79
|
readonly gap: number | undefined;
|
|
81
80
|
readonly offset: number | undefined;
|
|
82
81
|
readonly padding: number | undefined;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useInteractions } from "../utils/floating-ui/svelte/index.js";
|
|
2
2
|
import { useDisposables } from "../utils/disposables.js";
|
|
3
3
|
import { getContext, untrack } from "svelte";
|
|
4
|
-
export { useFloatingProvider } from "./floating-provider.svelte.js";
|
|
5
4
|
export function useResolvedAnchor(options) {
|
|
6
5
|
const { anchor } = $derived(options);
|
|
7
6
|
return {
|
|
@@ -15,7 +15,7 @@ export * from "./context.svelte.js";
|
|
|
15
15
|
generics="TTag extends ElementType = typeof DEFAULT_LISTBOX_TAG, TType = string, TActualType = TType extends (infer U)[] ? U : TType"
|
|
16
16
|
>import { disposables } from "../utils/disposables.js";
|
|
17
17
|
import FormFields from "../internal/FormFields.svelte";
|
|
18
|
-
import { useFloatingProvider } from "../internal/floating.svelte.js";
|
|
18
|
+
import { useFloatingProvider } from "../internal/floating-provider.svelte.js";
|
|
19
19
|
import { createOpenClosedContext, State } from "../internal/open-closed.js";
|
|
20
20
|
import { useLabels } from "../label/context.svelte.js";
|
|
21
21
|
import { useOutsideClick } from "../hooks/use-outside-click.svelte.js";
|
package/dist/menu/Menu.svelte
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
|
|
1
|
+
<script lang="ts" module>let DEFAULT_MENU_TAG = "svelte:fragment";
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<script lang="ts" generics="TTag extends ElementType = typeof DEFAULT_MENU_TAG">import { ActivationTrigger, createMenuContext, MenuStates } from "./context.svelte.js";
|
|
5
|
+
import { useOutsideClick } from "../hooks/use-outside-click.svelte.js";
|
|
6
|
+
import { useFloatingProvider } from "../internal/floating-provider.svelte.js";
|
|
3
7
|
import { createOpenClosedContext, State } from "../internal/open-closed.js";
|
|
4
8
|
import ElementOrComponent from "../utils/ElementOrComponent.svelte";
|
|
5
9
|
import { FocusableMode, isFocusableElement } from "../utils/focus-management.js";
|
|
6
10
|
import { match } from "../utils/match.js";
|
|
7
|
-
let DEFAULT_MENU_TAG = "svelte:fragment";
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<script lang="ts" generics="TTag extends ElementType = typeof DEFAULT_MENU_TAG">import { ActivationTrigger, createMenuContext, MenuStates } from "./context.svelte.js";
|
|
11
11
|
let { ref = $bindable(), __demoMode = false, ...theirProps } = $props();
|
|
12
12
|
const context = createMenuContext({
|
|
13
13
|
__demoMode,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ElementType, Props } from "../utils/types.js";
|
|
2
|
-
import type { Snippet } from "svelte";
|
|
3
2
|
declare let DEFAULT_MENU_TAG: string;
|
|
4
3
|
type MenuRenderPropArg = {
|
|
5
4
|
open: boolean;
|
|
@@ -13,7 +12,7 @@ declare class __sveltets_Render<TTag extends ElementType = typeof DEFAULT_MENU_T
|
|
|
13
12
|
props(): {
|
|
14
13
|
as?: TTag | undefined;
|
|
15
14
|
} & (Exclude<keyof import("../utils/types.js").PropsOf<TTag>, ("slot" | "as" | "children" | "class" | "ref") | "__demoMode"> extends infer T extends keyof import("../utils/types.js").PropsOf<TTag> ? { [P in T]: import("../utils/types.js").PropsOf<TTag>[P]; } : never) & {
|
|
16
|
-
children?: Snippet<[{
|
|
15
|
+
children?: import("svelte").Snippet<[{
|
|
17
16
|
slot: MenuRenderPropArg;
|
|
18
17
|
props: Record<string, any>;
|
|
19
18
|
}]> | undefined;
|