Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zag-js/tooltip

Package Overview
Dependencies
Maintainers
1
Versions
1030
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zag-js/tooltip - npm Package Compare versions

Comparing version 0.60.0 to 0.61.0

9

dist/index.d.ts

@@ -54,2 +54,7 @@ import * as _zag_js_anatomy from '@zag-js/anatomy';

/**
* Whether the tooltip should close on click
* @default true
*/
closeOnClick?: boolean;
/**
* Whether the tooltip's content is interactive.

@@ -129,5 +134,5 @@ * In this mode, the tooltip will remain open when user hovers over the content.

declare const props: ("dir" | "id" | "getRootNode" | "open" | "disabled" | "aria-label" | "ids" | "openDelay" | "closeDelay" | "closeOnPointerDown" | "closeOnEscape" | "closeOnScroll" | "interactive" | "onOpenChange" | "positioning" | "open.controlled")[];
declare const splitProps: <Props extends Partial<UserDefinedContext>>(props: Props) => [Partial<UserDefinedContext>, Omit<Props, "dir" | "id" | "getRootNode" | "open" | "disabled" | "aria-label" | "ids" | "openDelay" | "closeDelay" | "closeOnPointerDown" | "closeOnEscape" | "closeOnScroll" | "interactive" | "onOpenChange" | "positioning" | "open.controlled">];
declare const props: ("dir" | "id" | "getRootNode" | "open" | "disabled" | "aria-label" | "ids" | "openDelay" | "closeDelay" | "closeOnPointerDown" | "closeOnEscape" | "closeOnScroll" | "closeOnClick" | "interactive" | "onOpenChange" | "positioning" | "open.controlled")[];
declare const splitProps: <Props extends Partial<UserDefinedContext>>(props: Props) => [Partial<UserDefinedContext>, Omit<Props, "dir" | "id" | "getRootNode" | "open" | "disabled" | "aria-label" | "ids" | "openDelay" | "closeDelay" | "closeOnPointerDown" | "closeOnEscape" | "closeOnScroll" | "closeOnClick" | "interactive" | "onOpenChange" | "positioning" | "open.controlled">];
export { type MachineApi as Api, type UserDefinedContext as Context, type ElementIds, type OpenChangeDetails, type Service, anatomy, connect, machine, props, splitProps };

@@ -93,24 +93,33 @@ "use strict";

"aria-describedby": open ? contentId : void 0,
onClick() {
onClick(event) {
if (event.defaultPrevented) return;
if (disabled) return;
send("CLOSE");
if (!state.context.closeOnClick) return;
send({ type: "CLOSE", src: "trigger.click" });
},
onFocus() {
if (disabled || state.event.type === "POINTER_DOWN") return;
send("OPEN");
onFocus(event) {
if (event.defaultPrevented) return;
if (disabled) return;
if (state.event.src === "trigger.pointerdown") return;
send({ type: "OPEN", src: "trigger.focus" });
},
onBlur() {
onBlur(event) {
if (event.defaultPrevented) return;
if (disabled) return;
if (id === store.id) {
send("CLOSE");
send({ type: "CLOSE", src: "trigger.blur" });
}
},
onPointerDown() {
if (disabled || !state.context.closeOnPointerDown) return;
onPointerDown(event) {
if (event.defaultPrevented) return;
if (disabled) return;
if (!state.context.closeOnPointerDown) return;
if (id === store.id) {
send("CLOSE");
send({ type: "CLOSE", src: "trigger.pointerdown" });
}
},
onPointerMove(event) {
if (disabled || event.pointerType === "touch") return;
if (event.defaultPrevented) return;
if (disabled) return;
if (event.pointerType === "touch") return;
send("POINTER_MOVE");

@@ -194,2 +203,3 @@ },

closeOnScroll: true,
closeOnClick: true,
...ctx,

@@ -478,2 +488,3 @@ currentPlacement: void 0,

"closeOnScroll",
"closeOnClick",
"dir",

@@ -480,0 +491,0 @@ "disabled",

{
"name": "@zag-js/tooltip",
"version": "0.60.0",
"version": "0.61.0",
"description": "Core logic for the tooltip widget implemented as a state machine",

@@ -30,9 +30,9 @@ "keywords": [

"dependencies": {
"@zag-js/anatomy": "0.60.0",
"@zag-js/core": "0.60.0",
"@zag-js/popper": "0.60.0",
"@zag-js/dom-query": "0.60.0",
"@zag-js/dom-event": "0.60.0",
"@zag-js/utils": "0.60.0",
"@zag-js/types": "0.60.0"
"@zag-js/anatomy": "0.61.0",
"@zag-js/core": "0.61.0",
"@zag-js/popper": "0.61.0",
"@zag-js/dom-query": "0.61.0",
"@zag-js/dom-event": "0.61.0",
"@zag-js/utils": "0.61.0",
"@zag-js/types": "0.61.0"
},

@@ -39,0 +39,0 @@ "devDependencies": {

@@ -43,24 +43,33 @@ import { dataAttr } from "@zag-js/dom-query"

"aria-describedby": open ? contentId : undefined,
onClick() {
onClick(event) {
if (event.defaultPrevented) return
if (disabled) return
send("CLOSE")
if (!state.context.closeOnClick) return
send({ type: "CLOSE", src: "trigger.click" })
},
onFocus() {
if (disabled || state.event.type === "POINTER_DOWN") return
send("OPEN")
onFocus(event) {
if (event.defaultPrevented) return
if (disabled) return
if (state.event.src === "trigger.pointerdown") return
send({ type: "OPEN", src: "trigger.focus" })
},
onBlur() {
onBlur(event) {
if (event.defaultPrevented) return
if (disabled) return
if (id === store.id) {
send("CLOSE")
send({ type: "CLOSE", src: "trigger.blur" })
}
},
onPointerDown() {
if (disabled || !state.context.closeOnPointerDown) return
onPointerDown(event) {
if (event.defaultPrevented) return
if (disabled) return
if (!state.context.closeOnPointerDown) return
if (id === store.id) {
send("CLOSE")
send({ type: "CLOSE", src: "trigger.pointerdown" })
}
},
onPointerMove(event) {
if (disabled || event.pointerType === "touch") return
if (event.defaultPrevented) return
if (disabled) return
if (event.pointerType === "touch") return
send("POINTER_MOVE")

@@ -67,0 +76,0 @@ },

@@ -26,2 +26,3 @@ import { createMachine, guards, subscribe } from "@zag-js/core"

closeOnScroll: true,
closeOnClick: true,
...ctx,

@@ -28,0 +29,0 @@ currentPlacement: undefined,

@@ -11,2 +11,3 @@ import { createProps } from "@zag-js/types"

"closeOnScroll",
"closeOnClick",
"dir",

@@ -13,0 +14,0 @@ "disabled",

@@ -59,2 +59,7 @@ import type { Machine, StateMachine as S } from "@zag-js/core"

/**
* Whether the tooltip should close on click
* @default true
*/
closeOnClick?: boolean
/**
* Whether the tooltip's content is interactive.

@@ -61,0 +66,0 @@ * In this mode, the tooltip will remain open when user hovers over the content.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc