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

@viamrobotics/prime-core

Package Overview
Dependencies
Maintainers
6
Versions
168
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@viamrobotics/prime-core - npm Package Compare versions

Comparing version 0.0.70 to 0.0.71

9

dist/tooltip/__tests__/tooltip.spec.js

@@ -57,2 +57,11 @@ import { describe, it, expect } from 'vitest';

});
it('shows the tooltip on mouse enter after a delay', async () => {
const user = userEvent.setup();
render(Tooltip, { hoverDelayMS: 50 });
const target = screen.getByTestId('target');
const tooltip = screen.getByRole('tooltip');
await user.hover(target);
expect(tooltip).toHaveClass('invisible');
await waitFor(() => expect(tooltip).not.toHaveClass('invisible'));
});
it('shows/hides the tooltip on keyboard focus/blur', async () => {

@@ -59,0 +68,0 @@ render(Tooltip);

1

dist/tooltip/__tests__/tooltip.spec.svelte.d.ts

@@ -7,2 +7,3 @@ import { SvelteComponent } from "svelte";

state?: TooltipVisibility | undefined;
hoverDelayMS?: number;
};

@@ -9,0 +10,0 @@ events: {

4

dist/tooltip/tooltip-container.svelte.d.ts
import { SvelteComponent } from "svelte";
declare const __propDef: {
props: Record<string, never>;
props: {
hoverDelayMS?: number;
};
events: {

@@ -5,0 +7,0 @@ [evt: string]: CustomEvent<any>;

@@ -11,2 +11,3 @@ /// <reference types="svelte" />

setVisibility: (visibility: TooltipVisibility | undefined) => void;
setHoverDelayMS: (hoverDelayMS: number) => void;
setTarget: (target: HTMLElement | undefined) => void;

@@ -13,0 +14,0 @@ setTooltip: (options: {

@@ -5,2 +5,3 @@ import { setContext, getContext } from 'svelte';

import { uniqueId } from '../unique-id';
import noop from 'lodash/noop';
const CONTEXT_KEY = Symbol('tooltip');

@@ -34,4 +35,17 @@ /**

const visibility = writable();
const isVisible = derived([isHovered, visibility], ([$isHovered, $visibility]) => $visibility === 'visible' ||
Boolean($visibility === undefined && $isHovered));
const hoverDelayMS = writable();
const isVisible = derived([isHovered, visibility, hoverDelayMS], ([$isHovered, $visibility, $hoverDelayMS], set) => {
let cleanup = noop;
if ($visibility === 'visible') {
set(true);
}
else if ($visibility === 'invisible' || !$isHovered) {
set(false);
}
else {
const timeoutID = setTimeout(() => set(true), $hoverDelayMS);
cleanup = () => clearTimeout(timeoutID);
}
return cleanup;
}, false);
const style = floatingStyle({ offset: 7, shift: 5, flip: true, auto: true });

@@ -44,2 +58,3 @@ return {

setVisibility: visibility.set,
setHoverDelayMS: hoverDelayMS.set,
setTarget: (target) => style.register({ referenceElement: target }),

@@ -46,0 +61,0 @@ setTooltip: ({ tooltip, arrow, placement }) => {

@@ -15,2 +15,7 @@ import { SvelteComponent } from "svelte";

*/ state?: TooltipVisibility | undefined;
/**
* If state is `undefined`, the tooltip only renders on mouse enter and focus.
* On mouse enter, this delay is present before the tooltip is shown.
* There is no delay for focus.
*/ hoverDelayMS?: number;
/** Additional CSS classes to pass to the tooltip text element. */ cx?: cx.Argument;

@@ -17,0 +22,0 @@ };

{
"name": "@viamrobotics/prime-core",
"version": "0.0.70",
"version": "0.0.71",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

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