bits-ui 2.12.0 → 2.13.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.
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
children,
|
|
16
16
|
child,
|
|
17
17
|
onSelect = noop,
|
|
18
|
+
openDelay = 100,
|
|
18
19
|
...restProps
|
|
19
20
|
}: MenuSubTriggerProps = $props();
|
|
20
21
|
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
() => ref,
|
|
27
28
|
(v) => (ref = v)
|
|
28
29
|
),
|
|
30
|
+
openDelay: boxWith(() => openDelay),
|
|
29
31
|
});
|
|
30
32
|
|
|
31
33
|
const mergedProps = $derived(mergeProps(restProps, subTriggerState.props));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DOMContext, type ReadableBoxedValues, type WritableBoxedValues } from "svelte-toolbelt";
|
|
1
|
+
import { DOMContext, type ReadableBoxedValues, type WritableBoxedValues, type ReadableBox } from "svelte-toolbelt";
|
|
2
2
|
import { Context } from "runed";
|
|
3
3
|
import { CustomEventDispatcher } from "../../internal/events.js";
|
|
4
4
|
import type { AnyFn, BitsFocusEvent, BitsKeyboardEvent, BitsMouseEvent, BitsPointerEvent, OnChangeFn, RefAttachment, WithRefOpts } from "../../internal/types.js";
|
|
@@ -38,7 +38,7 @@ export declare class MenuMenuState {
|
|
|
38
38
|
readonly opts: MenuMenuStateOpts;
|
|
39
39
|
readonly root: MenuRootState;
|
|
40
40
|
readonly parentMenu: MenuMenuState | null;
|
|
41
|
-
contentId:
|
|
41
|
+
contentId: ReadableBox<string>;
|
|
42
42
|
contentNode: HTMLElement | null;
|
|
43
43
|
triggerNode: HTMLElement | null;
|
|
44
44
|
constructor(opts: MenuMenuStateOpts, root: MenuRootState, parentMenu: MenuMenuState | null);
|
|
@@ -157,6 +157,7 @@ export declare class MenuItemState {
|
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
interface MenuSubTriggerStateOpts extends MenuItemSharedStateOpts, Pick<MenuItemStateOpts, "onSelect"> {
|
|
160
|
+
openDelay: ReadableBox<number>;
|
|
160
161
|
}
|
|
161
162
|
export declare class MenuSubTriggerState {
|
|
162
163
|
#private;
|
|
@@ -149,8 +149,20 @@ export type MenuSubContentPropsWithoutHTML = Expand<WithChildNoChildrenSnippetPr
|
|
|
149
149
|
export type MenuSubContentProps = MenuSubContentPropsWithoutHTML & Without<BitsPrimitiveDivAttributes, MenuSubContentPropsWithoutHTML>;
|
|
150
150
|
export type MenuSubContentStaticPropsWithoutHTML = Expand<WithChildNoChildrenSnippetProps<Omit<PopperLayerStaticProps, "content" | "preventScroll"> & _SharedMenuContentProps, StaticContentSnippetProps>>;
|
|
151
151
|
export type MenuSubContentStaticProps = MenuSubContentStaticPropsWithoutHTML & Without<BitsPrimitiveDivAttributes, MenuSubContentStaticPropsWithoutHTML>;
|
|
152
|
-
export type MenuSubTriggerPropsWithoutHTML = Omit<MenuItemPropsWithoutHTML, "closeOnSelect"
|
|
153
|
-
|
|
152
|
+
export type MenuSubTriggerPropsWithoutHTML = Omit<MenuItemPropsWithoutHTML, "closeOnSelect"> & {
|
|
153
|
+
/**
|
|
154
|
+
* The amount of time in ms from when the mouse enters the subtrigger until
|
|
155
|
+
* the submenu opens. This is useful for preventing the submenu from opening
|
|
156
|
+
* as a user is moving their mouse through the menu without a true intention to open that
|
|
157
|
+
* submenu.
|
|
158
|
+
*
|
|
159
|
+
* To disable the behavior, set it to `0`.
|
|
160
|
+
*
|
|
161
|
+
* @default 100
|
|
162
|
+
*/
|
|
163
|
+
openDelay?: number;
|
|
164
|
+
};
|
|
165
|
+
export type MenuSubTriggerProps = MenuSubTriggerPropsWithoutHTML & Without<BitsPrimitiveDivAttributes, MenuSubTriggerPropsWithoutHTML>;
|
|
154
166
|
export type MenuSeparatorPropsWithoutHTML = WithChild;
|
|
155
167
|
export type MenuSeparatorProps = MenuSeparatorPropsWithoutHTML & Without<BitsPrimitiveDivAttributes, MenuSeparatorPropsWithoutHTML>;
|
|
156
168
|
export type MenuArrowPropsWithoutHTML = ArrowPropsWithoutHTML;
|